How can I convert the first character of a C# string to lowercase? -


can tell me how can this. know there functions convert lowercase first character.

there must multiple ways of doing that, can use char.tolower on first character , substring starting index 1. can try:

string str = "aaaaaa"; str = char.tolower(str[0]) + str.substring(1); 

it better if check string length, avoid exception.

if(str.length > 0) {    str = char.tolower(str[0]) + str.substring(1); } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -