The string contains a multibyte starting character, and we need to capitalize each word. String Contains Alphabet as a First Character Solutions to this case are straightforward. We can either use the built-intoupper()library function or can use our user-defined implementation. ...
string="learn Python"cap_string=string.capitalize()print("The capitalized string is:",cap_string) Output: The capitalized string is: Learn python If the first character in the string is a digit, it will not capitalize the first letter. To solve this problem, we can use theisdigit()function...
/ Duration-:- Loaded:0% There is a number of ways to capitalize the first letter of the string in JavaScript. For example: "this is an example"->"This is an example" "the Atlantic Ocean"->"The Atlantic Ocean" ThetoUpperCase()method transforms all letters in a string to uppercase...