How to reverse a string in .NET


This code snippet shows how to reverse a string in DotNet using the most simple way

There are situations when we need to reverse a particular string, specially when we do work with string. So I did mention the easiest way to do that in VB.Net and in C#.Net, as follow:-

VB.Net code:-
-------------------------------------

TextBox2.Text = StrReverse(TextBox1.Text)


C#.Net code:-
-------------------------------------
TextBox2.Text == Strings.StrReverse(TextBox1.Text)


Note: In both the cases above, I am reversing a string which is in a textbox control namely, TextBox1 and getting this reversed string to an another textbox contol namely, TextBox2


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: