Basically, the reverse of this. Here’s my attempt, but it’s not working.
def titlecase(value):
s1 = re.sub('(_)([a-z][A-Z][0-9]+)', r'\2'.upper(), value)
return s1
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Python is more readable than regex, and easier to fix when it’s not doing what you want.
If you want the first letter lowercase as well, I would use a second function that calls the function above to do most of the work, then just lowercases the first letter: