ITORIAN    

  public string Welcome() {

      return "Abhimanyu's Thoughts";

  }

My First E-Book
Quick Report
Yearly Posts:
   i) Oct-Nov 2010: 12
   ii) In 2011: 380
   iii) In 2012: 32

You can find my articles and blogs on:
   i) itorian.com
   ii) c-sharpcorner.com
   iii) dotnetfunda.com
   iv) codeproject.com

Greatest Hits
People I Follow
Disclaimer
This is my personal website and the opinions I have expressed here is my own. For any accuracy I recommend to visit official websites like MSDN for Microsoft. I developed this website to share my technical skills.

Convert To Proper Case in C#
In this quick post you will look at the method which will convert your string in Proper Case using C#.
Abhimanyu Kumar Vatsa

IT Faculty || I blog on Microsoft Technologies || Mindcracker MVP || Founder of ITORIAN.COM
   
Introduction

Here is a method which will convert your string in Proper Case, you just need to pass the string to this method and method will return the Proper Case string as a result.


public string ConvertToProperCase(string str)
        {
            string formattedStr = null;

            if (str == null)
            {
                formattedStr = new System.Globalization.CultureInfo("en").TextInfo.ToTitleCase(str.ToLower());
            }

            return formattedStr;
        }

Happy Coding !!



Join us on Facebook. Join us on Twitter.

   



Approved Comments

Rafiz 1/21/2012 8:32:05 PM
Rafiz: Woof, Cool method blogger.
Author: :)