C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
33
Reply
Print hello world as Olleh Dlrow ?
Rakesh Singh
10y
5k
3
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
string inputString = "Hello World";string result = string.Join(" ", inputString.Split(' ').Select(x => new String(x.Reverse().ToArray())));Console.WriteLine(result);Console.ReadLine();
Sanjay Kesarwani
9y
5
public static string Reverse( string s ) {char[] charArray = s.ToCharArray();Array.Reverse( charArray );return new string( charArray ); }
Shweta Lodha
10y
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
10y
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
8y
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
9y
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
9y
1
string obj= "Hello World"; for (int i = obj.Length - 1; i >= 0; i--) { Console.WriteLine(obj.[i]); }
Pankaj Kumar Choudhary
9y
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
10y
1
String result = “hello world”; For( int i = result.length-1 ; i>=0 ; i- -) { Console.writeline( result[i]); }
Rajani Pandey
8y
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
8y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
Bhuvanesh Mohankumar
9y
0
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
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
9y
0
string str = "Print hello" char[] arr = str.ToCharArray(); Array.Reverse(arr).ToString();
Sunil Babu
9y
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
9y
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
10y
0
Message