how to use toupper in C#? -
i ask how use .toupper()
function in c#. our professor told use .toupper()
. ex. when enter name , first letter of each input must capital letter.
ian bartolome entera (original input)
ian bartolome entera (output needed)
you can use textinfo.totitlecase method (even though professor said use .toupper()
quite easy!!!);
with specific culture;
string text = "ian bartolome entera"; textinfo textinfo = new cultureinfo("en-us", false).textinfo;//specify culture here string titlecase = textinfo.totitlecase(text); //ian bartolome entera
or current culture;
string text = "ian bartolome entera"; string titlecase = cultureinfo.currentculture.textinfo.totitlecase(text);
Comments
Post a Comment