namespace StringReverse
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the string to reverse the word");
var value = Console.ReadLine();
Console.WriteLine("Reverse words is : ");
if (value != null)
{
string[] strings = value.Split(' ');
foreach(var item in strings)
{
string reverseString = string.Empty;
for (int i = item.Count() - 1; i >= 0; i--)
{
reverseString += item[i];
}
Console.Write(reverseString + ' ');
}
Console.ReadLine();
}
}
}
}In this code snippet you will learn how to reverse letter on all words in a sentence in C# programming.
