//for e.g.
string s="this is example";
//how can i make output like "This Is Example"
using too simple code in c#??
The toupper() function is used to convert lowercase alphabet to uppercase.
To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.
h> int toupper(int c); int tolower(int c); DESCRIPTION toupper() converts the letter c to upper case, if possible. tolower() converts the letter c to lower case, if possible. If c is not an unsigned char value, or EOF, the behavior of these functions is undefined.
printf(“%c”,toupper(ch)); This printf() statement is printing the upper case value of the variable ch. This will be executed only when the above if statement becomes true.
Try this.
String s = "this is example";
Console.WriteLine(Thread.CurrentCulture.TextInfo.ToTitleCase(s));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With