Horje
capitalize first letter c# Code Example
c# capitalize first letter
string text = "john smith";

// "John smith"
string firstLetterOfString = text.Substring(0, 1).ToUpper() + text.Substring(1);

// "John Smith"
// Requires Linq! using System.Linq;
string firstLetterOfEachWord =
		string.Join(" ", text.Split(' ').ToList()
				.ConvertAll(word =>
						word.Substring(0, 1).ToUpper() + word.Substring(1)
				)
		);
capitalize first letter c#
using static System.Globalization.CultureInfo;
var str = CurrentCulture.TextInfo.ToTitleCase(sortColumn.ToLower().Trim());
c# make first letter uppercase
        System.Console.WriteLine(char.ToUpper(str[0]) + str.Substring(1));
c# capitalize first letter of each word in a string
string s = "THIS IS MY TEXT RIGHT NOW";
s = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());
c# capitalize first letter of each word in a string
string s = "THIS IS MY TEXT RIGHT NOW";

s = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());
first sentence letter capital in c#
public static class StringExtension
{
    public static string CapitalizeFirst(this string s)
    {
        bool IsNewSentense = true;
        var result = new StringBuilder(s.Length);
        for (int i = 0; i < s.Length; i++)
        {
            if (IsNewSentense && char.IsLetter(s[i]))
            {
                result.Append (char.ToUpper (s[i]));
                IsNewSentense = false;
            }
            else
                result.Append (s[i]);

            if (s[i] == '!' || s[i] == '?' || s[i] == '.')
            {
                IsNewSentense = true;
            }
        }

        return result.ToString();
    }
}




Csharp

Related
how to encode and decode a string in c# Code Example how to encode and decode a string in c# Code Example
get folders in directory c# Code Example get folders in directory c# Code Example
c# datagridview hide row selector Code Example c# datagridview hide row selector Code Example
how to not overwrite a text file in c# Code Example how to not overwrite a text file in c# Code Example
c# get all bytes of a file Code Example c# get all bytes of a file Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8