"this is a pen" this is input string ..how to get out put string"pen a is this " using c#
Reverse string
hi this is krishna
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VasanthRank #1,486 · 1.1K reputationPosted Apr 12, 2010, 8:20 AM EDT
Krishna , we have lot of logic here to find the solution ..
One of the answer is below , please check .
string strInputSentense = "this is a pen";
string[] arrInputWords = strInputSentense.Split(' ');
Array.Reverse(arrInputWords);
strInputSentense = string.Join(" ", arrInputWords);
Response.Write(strInputSentense);
Please mark as answer , if it helps you.