Horje
first sentence letter capital in c# Code Example
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
setting the parent of a transform which resides in a prefab Code Example setting the parent of a transform which resides in a prefab Code Example
c# picturebox transparente Code Example c# picturebox transparente Code Example
c# if file doesn't exist create it Code Example c# if file doesn't exist create it Code Example
c# modify dictionary in loop Code Example c# modify dictionary in loop Code Example
c# sum object values Code Example c# sum object values Code Example

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