How to make a first letter capital in C#

后端 未结 12 1163
攒了一身酷
攒了一身酷 2020-12-05 23:52

How can the first letter in a text be set to capital?

Example:

it is a text.  = It is a text.
12条回答
  •  伪装坚强ぢ
    2020-12-05 23:59

    Take the first letter out of the word and then extract it to the other string.

    strFirstLetter = strWord.Substring(0, 1).ToUpper();
    strFullWord = strFirstLetter + strWord.Substring(1);
    

提交回复
热议问题