Here I will explain how to reversing the words in sentence using Asp.net(C#)
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Programming.ReverseWords { class UsingReverseFunction { static void Main() { string input = "Nikhil Sangani is a Web Developer"; string output = string.Empty; string[] wordsininput = input.Split(' '); Array.Reverse(wordsininput); output = string.Join(" ", wordsininput); Console.WriteLine(output); Console.ReadLine(); } } }
Comments
Post a Comment