Click here to Skip to main content
12,447,961 members (69,663 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
Hi All,

I want to print the very first letter to capital from a group of words, when i try with vbpropercase it converts first letter of each word to capital. But i do not want that.

Eg., shipping company
should be printed as Shipping company instead of Shipping Company

Help ASAP.

Thanks in advance.
Posted 6-Apr-13 0:36am
Updated 6-Apr-13 0:43am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

private string FirstLetterToUpper(string word)
{
    StringBuilder sb = new StringBuilder();
    if (!string.IsNullOrWhiteSpace(word))
    {
        sb.Append(word.Substring(0, 1).ToUpper());
        sb.Append(word.Substring(1, word.Length - 1));
    }
    return sb.ToString();           
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160811.3 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100