33
Reply

Print hello world as Olleh Dlrow ?

Rakesh Singh

Rakesh Singh

Jan 18, 2016
5k
3

    string inputString = "Hello World";string result = string.Join(" ", inputString.Split(' ').Select(x => new String(x.Reverse().ToArray())));Console.WriteLine(result);Console.ReadLine();

    Sanjay Kesarwani
    May 13, 2016
    5

    public static string Reverse( string s ) {char[] charArray = s.ToCharArray();Array.Reverse( charArray );return new string( charArray ); }

    Shweta Lodha
    January 21, 2016
    3

    really sorry for the above reply..Please find below the solution class Program{static void Main(string[] args){string LabOne = "Hello World";for (int i = LabOne.Length - 1; i >= 0; i--){Console.WriteLine(LabOne.[i]);}}}

    Nishant Mittal
    January 19, 2016
    2

    class Program{static string sk = null;static void Main(string[] args){sk = "hellO worlD";string[] s1 = sk.Split(' ');string s2 = s1[0];string s3 = s1[1];char[] d1 = s2.ToCharArray();Array.Reverse(d1);Console.Write(d1);Console.Write(" ");char[] d2 = s3.ToCharArray();Array.Reverse(d2);Console.WriteLine(d2);Console.ReadLine();}}

    Sudhakar Patil
    April 06, 2017
    1

    string strInput = "hello world";string strOutput = string.Join(" ", strInput.Split(' ').Select(y => new String(y.Reverse().ToArray())));Console.WriteLine(strOutput);Console.ReadLine();

    Ramesh S
    November 24, 2016
    1

    string obj= "Hello World";string[] _splitobj = obj.Split(' ');for (int i = 0; i < _splitobj.Length;i++ ){for (int k = _splitobj[i].Length - 1; k >= 0;k-- ){Console.Write(_splitobj[i][k].ToString());}Console.Write(" ");}

    chandan yadav
    May 13, 2016
    1

    string obj= "Hello World"; for (int i = obj.Length - 1; i >= 0; i--) { Console.WriteLine(obj.[i]); }

    Pankaj Kumar Choudhary
    February 09, 2016
    1

    I think you have to use the concept of localization and globalization in C#..I dont know which language is this Olleh Dlrow

    Nishant Mittal
    January 19, 2016
    1

    String result = “hello world”; For( int i = result.length-1 ; i>=0 ; i- -) { Console.writeline( result[i]); }

    Rajani Pandey
    January 07, 2018
    0

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace Helloworldrv {class Program{static string sk = null;static void Main(string[] args){sk = "Hello World";char[] charArray = sk.ToCharArray();Array.Reverse(charArray);Console.WriteLine(charArray);Console.ReadLine();}} }

    Sudhakar Patil
    April 06, 2017
    0

    public static string Foo(string data, string seperator){return string.Join(seperator, data.Split(new string[] { seperator }, StringSplitOptions.RemoveEmptyEntries).Select(x => new string(x.Reverse().ToArray())).Select(y => y.ToLower().Replace(y.Substring(0, 1), y.Substring(0, 1).ToUpper())));}

    Anas PK
    January 16, 2017
    0

    string str = "hello world";string rvrse = "";string rvrse1 = "";string[] obj = str.Split(' ');string s1 = obj[0];string s2 = obj[1];for(int i = obj[0].Length-1;i>=0;i--){rvrse = rvrse + s1[i];}for(int j = obj[1].Length-1;j>=0;j--){rvrse1 = rvrse1 + s2[j];}string chk = rvrse.First().ToString().ToUpper() + rvrse.Substring(1);string chk1 = rvrse1.First().ToString().ToUpper() + rvrse1.Substring(1);Console.WriteLine(chk +" "+ chk1);

    sumen bhattacharya
    October 25, 2016
    0

    string str = "hello world";string rvrse = "";string rvrse1 = "";string[] obj = str.Split(' ');string s1 = obj[0];string s2 = obj[1];for(int i = obj[0].Length-1;i>=0;i--){rvrse = rvrse + s1[i];}for(int j = obj[1].Length-1;j>=0;j--){rvrse1 = rvrse1 + s2[j];}string chk = rvrse.First().ToString().ToUpper() + rvrse.Substring(1);string chk1 = rvrse1.First().ToString().ToUpper() + rvrse1.Substring(1);Console.WriteLine(chk +" "+ chk1);

    sumen bhattacharya
    October 25, 2016
    0

    Sub Main()Dim inputString As String = "Hello World"Dim result = String.Join(" ", inputString.Split(" ").Select(Function(x) StrConv(String.Join("", x.Reverse().ToArray()), VbStrConv.ProperCase)))Console.WriteLine(result)Console.ReadLine()End Sub

    Somesh Srivastava
    September 18, 2016
    0

    I have written in VB. You may convert it in C#Sub Main()Dim inputString As String = "Hello World"Dim result = String.Join(" ", inputString.Split(" ").Select(Function(x) StrConv(String.Join("", x.Reverse().ToArray()), VbStrConv.ProperCase)))Console.WriteLine(result)Console.ReadLine()End Sub

    Somesh Srivastava
    September 18, 2016
    0

    Static Void Main() {Console.WriteLine("type sentence");String str = Console.ReadLine();string revStr = " " ;foreach(var word in str.Split(' ')){string temp = " ";foreach(var ch in word.ToCharArray()){temp = ch temp;}revStr = revStr temp " ";}Console.writeLine(revStr);Console.ReadLine(); }

    Vinay K
    July 06, 2016
    0

    string inputString = "Hello World"; string result = string.Join(" ", inputString .Split(' ') .Select(x => new String(x.Reverse().ToArray()))); Console.WriteLine(result); Console.ReadLine();

    Ashutosh Pandey
    June 11, 2016
    0

    string inputString = "Hello World"; string result = string.Join(" ", inputString .Split(' ') .Select(x => new String(x.Reverse().ToArray()))); Console.WriteLine(result); Console.ReadLine();

    Ashutosh Pandey
    June 11, 2016
    0

    string inputString = "Hello World"; string result = string.Join(" ", inputString .Split(' ') .Select(x => new String(x.Reverse().ToArray()))); Console.WriteLine(result); Console.ReadLine();

    Ashutosh Pandey
    June 11, 2016
    0

    1) Add the word by word in string of arrays, 2) Reverse the string value and then print the same.Hellow world is reversed and printed as Olleh Dlrow

    string [] phrase= "hello world".Splt(' '); foreach(var word in phrase) {string reversed = Array.Reverse(word.ToCharArray());Console.Write("{0}{1} ",char.ToUpper(reversed[0]), reversed.Substring(1)); }

    Rodrick Edwards
    May 27, 2016
    0

    string inputString = "Hello World"; string result = string.Join(" ", inputString .Split(' ') .Select(x => new String(x.Reverse().ToArray()))); Console.WriteLine(result); Console.ReadLine();

    vivekkumar kumar
    May 25, 2016
    0

    string inputString = "Hello World"; string result = string.Join(" ", inputString .Split(' ') .Select(x => new String(x.Reverse().ToArray()))); Console.WriteLine(result); Console.ReadLine();

    vivekkumar kumar
    May 25, 2016
    0

    string obj= "Hello World";string[] _splitobj = obj.Split(' ');for (int i = 0; i < _splitobj.Length;i++ ){for (int k = _splitobj[i].Length - 1; k >= 0;k-- ){Console.Write(_splitobj[i][k].ToString());}Console.Write(" ");}

    chandan yadav
    May 13, 2016
    0

    string obj= "Hello World";string[] _splitobj = obj.Split(' ');for (int i = 0; i < _splitobj.Length;i++ ){for (int k = _splitobj[i].Length - 1; k >= 0;k-- ){Console.Write(_splitobj[i][k].ToString());}Console.Write(" ");}

    chandan yadav
    May 13, 2016
    0

    string obj= "Hello World";string[] _splitobj = obj.Split(' ');for (int i = 0; i < _splitobj.Length;i++ ){for (int k = _splitobj[i].Length - 1; k >= 0;k-- ){Console.Write(_splitobj[i][k].ToString());}Console.Write(" ");}

    chandan yadav
    May 13, 2016
    0

    string obj= "Hello World";string[] _splitobj = obj.Split(' ');for (int i = 0; i < _splitobj.Length;i++ ){for (int k = _splitobj[i].Length - 1; k >= 0;k-- ){Console.Write(_splitobj[i][k].ToString());}Console.Write(" ");}

    chandan yadav
    May 13, 2016
    0

    string obj= "Hello World";string[] _splitobj = obj.Split(' ');for (int i = 0; i < _splitobj.Length;i++ ){for (int k = _splitobj[i].Length - 1; k >= 0;k-- ){Console.Write(_splitobj[i][k].ToString());}Console.Write(" ");}

    chandan yadav
    May 13, 2016
    0

    class Program{static void Main(string[] args){string str = "Hello World";if (!string.IsNullOrEmpty(str)){Console.WriteLine("{0}", ReverseString(str));Console.ReadLine();}else Console.WriteLine("String is empty");}private static string ReverseString(string str){string revStr = "";char sepearator = ' ';string[] strArray = str.Split(sepearator);for (int i = 0; i < strArray.Count(); i++){if(i == 1){revStr += " ";}for (int j = strArray[i].Length; j > 0; j--){if (j == strArray[i].Length){revStr += strArray[i].Substring(j - 1, 1).ToUpper();}else{revStr += strArray[i].Substring(j - 1, 1).ToLower();}}}return revStr;}}

    Nikhil Khandelwal
    May 09, 2016
    0

    public StringBuilder ReverseString(string input){StringBuilder reverseString = new StringBuilder();foreach (string str in input.Split()){Char[] charArr = str.ToCharArray();for (int i = charArr.Length-1; i >= 0; i--){Console.WriteLine(charArr[i]);}reverseString.Append(" ");}return reverseString;}

    Rahul Chavan
    April 06, 2016
    0

    string str = "Print hello" char[] arr = str.ToCharArray(); Array.Reverse(arr).ToString();

    Sunil Babu
    April 02, 2016
    0

    string Str = "Hello World"; string Revstr = ""; for (int i = Str.Length - 1; i >= 0; i--) {Revstr += Str[i]; }Console.WriteLine("Reverse String Is {0}", Revstr);

    vipin kv
    March 10, 2016
    0

    class Program{static void Main(string[] args){string LabOne = "Hello World";string TempString = string.Empty;string[] strArray = LabOne.Split(' ');foreach (string item in strArray){for (int i = item.Length - 1; i >= 0; i--){TempString += item[i];}TempString += ' ';}//Now TempString='olleH dlroW'//Converting into Title caseTextInfo textInfo = new CultureInfo("en-US", false).TextInfo;TempString = textInfo.ToTitleCase(TempString); Console.WriteLine(TempString);Console.Read();}

    Aneez A
    January 23, 2016
    0