How to capitalize a word in C#
This can be easily done via TextInfo class:
name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(name));
Additionally, LINQ can greatly help iterating over a collection:
lst.ForEach(ci => ci.Name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(ci.Name));
Category: .net, tips
Comments