Capitalize
Capitalizes the first letter of a string.
- Use
string.ToCharArray()
to convert the string to an array ofchar
,chars
. - Use
char.ToUpper(chars[0])
to capitalize the first letter. - Finally, return a
new string()
from thechars
array.
Capitalizes the first letter of a string.
string.ToCharArray()
to convert the string to an array of char
, chars
.char.ToUpper(chars[0])
to capitalize the first letter.new string()
from the chars
array.