mikedopp

Geekswithblogs (edition)

  Home  |   Contact  |   Syndication    |   Login
  76 Posts | 0 Stories | 99 Comments | 0 Trackbacks

News

Twitter












Tag Cloud


Archives

My Blogs

How to reverse a string demo. *you need to know this if you want a job at Microsoft.

public string someMethod(string, input)

{

char[] chars = input.ToCharArray();

Array.Reverse(chars);

return new string(chars);

}

Go ahead and cheat. its ok.

posted on Thursday, March 06, 2008 6:55 PM

Feedback

# re: Reverse a String .NET 3/6/2008 12:14 PM Granville Barnett
I doubt you would ever get a problem as easy as that. I really can't see that ever being asked - IF they did I doubt they would let you use functions exposed by the framework.

Reversing the words of a string maybe, but reversing a string - probably not. Just to easy.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: