top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to Convert All Strings in a List to Upper Case using LINQ in C#?

0 votes
884 views
How to Convert All Strings in a List to Upper Case using LINQ in C#?
posted May 11, 2016 by Jayshree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
using System;

using System.Collections.Generic;

using System.Data;

using System.Linq;

namespace AbundantCode

{

internal class Program

{

//Convert All Strings in a List to Upper Case using LINQ in C#

private static void Main(string[] args)

{

List<string> Names = new List<string>();

Names.Add("Abundantcode");

Names.Add("Programming");

Names.Add("Websites");

Names.Add("Coding");

Names.Add("Technologies");

Names.Add("USA");

Names.Add("C#");

Names.Add(".NET");

var result = Names.Select(m => m.ToUpper());

foreach(var item in result)

Console.WriteLine(item);

Console.ReadLine();

}

}

}
answer May 11, 2016 by Shivaranjini
...