string title capitalize the apostrophe python code example
Example: title case with apostrophe in python
import re
def titlecase(s):
return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
lambda mo: mo.group(0).capitalize(),
s)