Ağu 26 2009

How to Capitalize the First Letter of Each Words in a string in C#

Category: C#Latif @ 16:24

Hi,

İf you wonder as to how to capitalize simply first letter of each words in a string, you can use ToTitleCase.

Check the sample below,

using System;

using System.Globalization;

 

namespace ToTitleCaseApp

{

    class Program

    {

        static void Main(string[] args)

        {

            string capitalizedFirstLetter = CultureInfo.CurrentCulture.TextInfo.ToTitleCase("shoot for the moon. even if you miss, you'll land among the stars.");

            Console.WriteLine(capitalizedFirstLetter);

            Console.ReadKey();

        }

    }

}

 

Result :

Shoot For The Moon. Even If You Miss, You'll Land Among The Stars.

I think, it is a handy method.

have a good time!

Tags: ,

Comments

1.
download steam wallet hack download steam wallet hack United States says:

Hmm is anyone else having problems with the images on this blog loading? I'm trying to find out if its a problem on my end or if it's the blog. Any feedback would be greatly appreciated.  Here is my web page ...  download steam wallet hack - http://leah-is-justins-whoran.tumblr.com/