Click here to Skip to main content
11,410,365 members (56,399 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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 1:36am
Edited 6-Apr-13 1: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
0 Sergey Alexandrovich Kryukov 129
1 Sascha Lefévre 95
2 Maciej Los 68
3 BillWoodruff 60
4 OriginalGriff 60
0 Sergey Alexandrovich Kryukov 8,755
1 OriginalGriff 6,915
2 Maciej Los 3,390
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web01 | 2.8.150414.5 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2015
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