Rakesh Singh
Print hello world as Olleh Dlrow ?
By Rakesh Singh in C# on Jan 18 2016
  • Sanjay Kesarwani
    May, 2016 13

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

    • 5
  • Shweta Lodha
    Jan, 2016 21

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

    • 3
  • Nishant Mittal
    Jan, 2016 19

    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]);}}}

    • 2
  • Sudhakar Patil
    Apr, 2017 6

    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();}}

    • 1
  • Ramesh S
    Nov, 2016 24

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

    • 1
  • chandan yadav
    May, 2016 13

    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(" ");}

    • 1
  • Pankaj  Kumar Choudhary
    Feb, 2016 9

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

    • 1
  • Nishant Mittal
    Jan, 2016 19

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

    • 1
  • Rajani Pandey
    Jan, 2018 7

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

    • 0
  • Sudhakar Patil
    Apr, 2017 6

    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();}} }

    • 0
  • Anas PK
    Jan, 2017 16

    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())));}

    • 0
  • sumen bhattacharya
    Oct, 2016 25

    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);

    • 0
  • sumen bhattacharya
    Oct, 2016 25

    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);

    • 0
  • Somesh Srivastava
    Sep, 2016 18

    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

    • 0
  • Somesh Srivastava
    Sep, 2016 18

    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

    • 0
  • Vinay K
    Jul, 2016 6

    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(); }

    • 0
  • Ashutosh Pandey
    Jun, 2016 11

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

    • 0
  • Ashutosh Pandey
    Jun, 2016 11

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

    • 0
  • Ashutosh Pandey
    Jun, 2016 11

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

    • 0
  • Bhuvanesh Mohankumar
    May, 2016 29

    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

    • 0
  • Rodrick Edwards
    May, 2016 27

    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)); }

    • 0
  • vivekkumar kumar
    May, 2016 25

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

    • 0
  • vivekkumar kumar
    May, 2016 25

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

    • 0
  • chandan yadav
    May, 2016 13

    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(" ");}

    • 0
  • chandan yadav
    May, 2016 13

    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(" ");}

    • 0
  • chandan yadav
    May, 2016 13

    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(" ");}

    • 0
  • chandan yadav
    May, 2016 13

    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(" ");}

    • 0
  • chandan yadav
    May, 2016 13

    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(" ");}

    • 0
  • Nikhil Khandelwal
    May, 2016 9

    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;}}

    • 0
  • Rahul Chavan
    Apr, 2016 6

    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;}

    • 0
  • Sunil Babu
    Apr, 2016 2

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

    • 0
  • vipin kv
    Mar, 2016 10

    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);

    • 0
  • Aneez A
    Jan, 2016 23

    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();}

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS