Answers for "title case with apostrophe in python"

1

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)
Posted by: Guest on March-25-2020

Python Answers by Framework

Browse Popular Code Answers by Language