How to capitalize the first character of each word in a string

Is there a function built into Java that capitalizes the first character of each word in a String, and does not affect the others? Examples: jon skeet -> Jon Skeet miles o’Brien -> Miles O’Brien (B remains capital, this rules out Title Case) old mcdonald -> Old Mcdonald* *(Old McDonald would be find too, but … Read more

How to change a string into uppercase

I have problem in changing a string into uppercase with Python. In my research, I got string.ascii_uppercase but it doesn’t work. The following code: >>s=”sdsd” >>s.ascii_uppercase Gives this error message: Traceback (most recent call last): File “<console>”, line 1, in <module> AttributeError: ‘str’ object has no attribute ‘ascii_uppercase’ My question is: how can I convert … Read more

How to convert a string to lower or upper case in Ruby

How do I take a string and convert it to lower or upper case in Ruby? 1 11 Ruby has a few methods for changing the case of strings. To convert to lowercase, use downcase: “hello James!”.downcase #=> “hello james!” Similarly, upcase capitalizes every letter and capitalize capitalizes the first letter of the string but … Read more