I have this code:
Long_string = """
"Fifty Shades of Grey” shakeup: Kelly Marcel not returning for Sequel
"""
I need to break down the string into words. I do:
text_to_list = testing.split()
the output is:
['\xa1\xb0Fifty', 'Shades', 'of', 'Grey\xa1\xb1', 'shakeup:', 'Kelly', 'Marcel', 'not', 'returning', 'for', 'Sequel']
however some of those have special meanings when together, like the quoted “Fifty Shades of Grey”, and people’s name of together capitalized words like “Kelly Marcel”.
So I want to turn them into “Fifty-Shades-of-Grey” and “Kelly-Marcel” when they are split. How can I do that?
Sorry for the confusion. The need is to:
replace the space to "-" when it is:
- in between words quoted
- in between 2 capitalized words