using System.Globalization;
using System.Threading;
// The below function takes the string and split it using space and change the first character alone to //capital letter
// Input : i love india
// Output: I Love India
public string changeName(string inputname)
{
string modifiedname = string.Empty;
string[] names = inputname.Split(' ');
foreach (string name in names)
{
CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
TextInfo txtinfo = cultureInfo.TextInfo;
string temp=txtinfo.ToTitleCase(name);
modifiedname = string.Concat(temp, " ");
}
return modifiedname;
}The below C# function takes the string and split it using space and change the first character alone to capital letter.
