Split String Based On Upper Case

string ConvertToWord(string value)
{
    StringBuilder builder = new StringBuilder();
    foreach (char c in value)
    {
        if (Char.IsUpper(c) && builder.Length>0)
        {
            builder.Append(' ');
        }

        builder.Append(c);
    }

    string result = builder.ToString();
    return result;
}


//Usage:
string beforeConvert = "IAmAGoodBoy";
string afterConvert = ConvertToWord(beforeConvert); //I Am A Good Boy

Change case of a string in C#


namespace CasingChange
{
    class Program
    {
        static void Main(string[] args)
        {
            String text = "HELLO World";
            System.Globalization.CultureInfo cultureInfo =          
                  System.Threading.Thread.CurrentThread.CurrentCulture;
            System.Globalization.TextInfo textInfo = cultureInfo.TextInfo;
            Console.WriteLine(textInfo.ToTitleCase(text.ToLower()));
            Console.WriteLine(FirstLetterToUpper(text.ToLower()));
            Console.ReadLine();
        }

        static string FirstLetterToUpper(string str)
        {
            if (str == null) return null;

            if (str.Length > 1) return char.ToUpper(str[0]) + str.Substring(1);

            return str.ToUpper();
        }
    }
}