Interviews - C# Corner

Murali Reddy
How To reverse the words of a string
By Murali Reddy in ASP.NET onAug 20 2013
  • Lalit Raghav
    May, 2015 20

    string str = "1234";Char[] chaArray=str.ToCharArray();Array.Reverse(chaArray);string st2 = new string(chaArray);

    • 0
  • Murali Reddy
    Aug, 2013 20

     public class Sample
        {

           public void m1()
           {
               string str = "Plant An Idea";
               string rev = "";
               string[] strArr = str.Split(' ');
                 for(int i=strArr.Length-1;i>=0;i--)
                 {
                     rev = rev + strArr[i] + " ";
                 }
               Console.WriteLine(rev);
           }
    }

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS