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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -