Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

reverse string without using any C# function

$
0
0

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 


Viewing all articles
Browse latest Browse all 12583

Trending Articles


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom