Swapping two words using LINQ

Prabhukiran345
Posted by Prabhukiran345 under LINQ category on | Points: 40 | Views : 718
public static void Main()
{
string name = "Prabhu, kiran";
name = string.Join(", ", name.Split(',').Reverse()).Trim();
Console.WriteLine(name);
Console.ReadLine();
}

Output Will Be:
Kiran,Prabhu

Comments or Responses

Login to post response