How do I make the first letter of a string uppercase, but not change the case of any of the other letters?
"this is a test"->
"This is a test"
"the Eiffel Tower"->
"The Eiffel Tower"
I have sent a mail to an address with a suffix of @rediffmail. But instead i wrote @Rediffmail. As you can see the 'R' is capitalized when it is not supposed to be. What I want to ask is that will the email still reach the recipient?I tried testing it from gmail but it automatically changes the 'R' to 'r'.
How do I format a string to title case?
I searched high and low but could only find indirect references to this type of question. When developing an android application, if you have a string which has been entered by the user, how can you convert it to title case (ie. make the first letter of each word upper case)? I would rather not import a whole library (such as Apache's WordUtils).
I was asked to capitalize the first letter of each word in a sentence and return the number of letters that have been capitalized. I have this so far:
text = input('Enter a sample text:\n')sentence = text.split('.') for i in sentence: print (i.strip().capitalize()+". ",end='')
I just need to figure out how to count how many times a letter has been capitalized.