Reverse and Normal String with out Function

Jayakumars
Posted by Jayakumars under ASP.NET category on | Points: 40 | Views : 802

string st = "Welcome";
string Totstr = "";
string Totstr1 = "";
//Reverse String Without Function
for (int i = st.Length - 1; i >=0 ; i--)
{
Totstr = Totstr + st[i];
}
Response.Write(Totstr);

//Actual String Without Function
string st1 = Totstr;

for (int i = Totstr.Length-1; i >= 0; i--)
{
Totstr1 = Totstr1 + st1[i];
}
Response.Write(Totstr1);

Comments or Responses

Login to post response