Skip to content

Instantly share code, notes, and snippets.

@darighost
Created November 20, 2022 22:51
Show Gist options
  • Save darighost/8a5377bbcdfa48825bd88bf19ab3addf to your computer and use it in GitHub Desktop.
Save darighost/8a5377bbcdfa48825bd88bf19ab3addf to your computer and use it in GitHub Desktop.
Quick one liner I used to make a long title camel case
' '.join([i[0].upper() + i[1:] for i in s.split()])
@darighost
Copy link
Author

Actually, I mean title case, since the first letter is also capitalized

@darighost
Copy link
Author

And thanks to StackOverflow, I've now learned about the .title() method for strings: https://stackoverflow.com/questions/8347048/how-to-convert-string-to-title-case-in-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment