[B]How can we Reverse a string Fully[/B]

Posted by Ras90it under C# on 6/18/2012 | Points: 10 | Views : 799 | Status : [Member] | Replies : 2
How can we Reverse a string Fully

Input : This Is Very Nice Place

Output : ecalP eciN yreV sI sihT

by

Raseeth.A



Responses

Posted by: Girinarra on: 6/18/2012 [Member] Starter | Points: 25

Up
0
Down
private string RevesreString(string String)
{
string MainString = string.Empty;
MainString = String;
string ReverseString = string.Empty;
for (int i = 1; i < MainString.Length+1; i++)
{
ReverseString = ReverseString + MainString[MainString.Length - i].ToString();
}
Response.Write(ReverseString);
return ReverseString;
}

Ras90it, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajay.Kalol on: 6/19/2012 [Member] Starter | Points: 25

Up
0
Down
Input : This Is Very Nice Place

in Code behine:

var str[] = input.TocharArray();
stringBuilder str1
for (int i=str.lenth; i>0; i--)
{
str1.append(str[i].toString());
}

response.write(str1.toString());

Your output will :: ecalP eciN yreV sI sihT

Ajay
ajaypatelfromsanthal.blogspot.in

Ras90it, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response