hi
i want to reverse string just like
input is "My Name is Khan"
output is "Khan is Name My"
my function is
public sring reverse()
{
string str=" my name is khan";
string str1=string.empty;
string[] strArr=str.split(' ');
for (int i=strArr.length; i>0; i--)
{
str1=str1+strArr[i]+" ";
}
return str1;
}
this is right function to reverse string as i want
i don't to use split function as we used in my code str.split(' ');
so please give me logic how we can reverse a string without using split function
thanks in advance