Something like StrRev?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Something like StrRev?

    I am just wondering if there is a C# equivalent to the VB StrRev function? I
    have
    written my own, but was wondering if there is a built-in way?

    JRB


  • Jon Skeet

    #2
    Re: Something like StrRev?

    <<jrb>> wrote:[color=blue]
    > I am just wondering if there is a C# equivalent to the VB StrRev function? I
    > have written my own, but was wondering if there is a built-in way?[/color]

    It would help if you'd say what StrRev does, but guessing that it
    reverses a string, the easiest way (IMO) would be:

    char[] chars = original.ToChar Array();
    Array.Reverse(c hars);
    string reversed = new string (chars);

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • Guest's Avatar

      #3
      Re: Something like StrRev?

      I apologize for not being clearer (I just thought everyone knew that one).
      Thanks.

      jrb

      "Jon Skeet" <skeet@pobox.co m> wrote in message
      news:MPG.19e786 a3dd781ef598969 5@10.1.1.14...[color=blue]
      > <<jrb>> wrote:[color=green]
      > > I am just wondering if there is a C# equivalent to the VB StrRev[/color][/color]
      function? I[color=blue][color=green]
      > > have written my own, but was wondering if there is a built-in way?[/color]
      >
      > It would help if you'd say what StrRev does, but guessing that it
      > reverses a string, the easiest way (IMO) would be:
      >
      > char[] chars = original.ToChar Array();
      > Array.Reverse(c hars);
      > string reversed = new string (chars);
      >
      > --
      > Jon Skeet - <skeet@pobox.co m>
      > http://www.pobox.com/~skeet
      > If replying to the group, please do not mail me too[/color]


      Comment

      • Jon Skeet

        #4
        Re: Something like StrRev?

        <<jrb>> wrote:[color=blue]
        > I apologize for not being clearer (I just thought everyone knew that one).[/color]

        Probably all VB programmers do - but not everyone who reads the C#
        newsgroup is a VB programmer :)

        Anyway, I assume I guessed correctly :)

        --
        Jon Skeet - <skeet@pobox.co m>
        Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

        If replying to the group, please do not mail me too

        Comment

        Working...