Created
June 27, 2013 12:34
-
-
Save enagorny/5876063 to your computer and use it in GitHub Desktop.
Simple proper capitalize in sentences in string.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
text = "SPITFIRE 1950S STYLE CAT EYE WAYFARER SUNGLASSES WITH CLEAR ACETATE FRAME SILVER METAL ARMS BLACK BROW DETAIL AND GREEN LENSES." | |
rtn = re.split('([.!?] *)', text) | |
result = ''.join([each.capitalize() for each in rtn]) | |
# print(result) | |
# Spitfire 1950s style cat eye wayfarer sunglasses with clear acetate frame silver metal arms black brow detail and green lenses. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment