hi a basic code on how to reverse a word(string) in c#.net.
Logic :
string reverseStr()
{
string s = "programming";
char[] c = s.ToCharArray();
string strReverse = "";
for (int i = c.Length - 1; i > -1; i--)
{
strReverse += c[i];
}
return strReverse;
}
Example:
No comments:
Post a Comment