string inputString = "Hello World";string result = string.Join(" ", inputString.Split(' ').Select(x => new String(x.Reverse().ToArray())));Console.WriteLine(result);Console.ReadLine();
public static string Reverse( string s ) {char[] charArray = s.ToCharArray();Array.Reverse( charArray );return new string( charArray ); }
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]);}}}
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();}}
string strInput = "hello world";string strOutput = string.Join(" ", strInput.Split(' ').Select(y => new String(y.Reverse().ToArray())));Console.WriteLine(strOutput);Console.ReadLine();
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(" ");}
string obj= "Hello World"; for (int i = obj.Length - 1; i >= 0; i--) { Console.WriteLine(obj.[i]); }
I think you have to use the concept of localization and globalization in C#..I dont know which language is this Olleh Dlrow
String result = “hello world”; For( int i = result.length-1 ; i>=0 ; i- -) { Console.writeline( result[i]); }
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();}} }
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())));}
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);
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
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
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(); }
string inputString = "Hello World"; string result = string.Join(" ", inputString .Split(' ') .Select(x => new String(x.Reverse().ToArray()))); Console.WriteLine(result); Console.ReadLine();
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)); }
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;}}
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;}
string str = "Print hello" char[] arr = str.ToCharArray(); Array.Reverse(arr).ToString();
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);
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();}