Hi guys,
I am back again with a new question cos I really can't figure out why...
From the code I can't tell which line makes the first letter of the words Capital. It's been many days already but I just duno.....:bi_polo:
And also the below line of code, I thought it says it will not capitalize if the letter is found in the string s ?
capitalize = !Char.IsLetter(c); // ???
Hope someone can tell me how to decipher....million thanks.
I am back again with a new question cos I really can't figure out why...
class Program { // changing the first letter of each word to Capital letter static void Main(string[] args) { string s = "institute of web technologies science"; StringBuilder sb = new StringBuilder(s.Length); bool capitalize = true; foreach (Char c in s) { sb.Append(capitalize ? Char.ToUpper(c) : Char.ToLower(c));// note Char and char is the same capitalize = !Char.IsLetter(c); // ??? } sb.ToString(); Console.Write(sb); } } }
From the code I can't tell which line makes the first letter of the words Capital. It's been many days already but I just duno.....:bi_polo:
And also the below line of code, I thought it says it will not capitalize if the letter is found in the string s ?
capitalize = !Char.IsLetter(c); // ???
Hope someone can tell me how to decipher....million thanks.
Last edited by a moderator: