I want to eliminate white space between 2 words among sentence containing many words
My code looks like this:
import re
sentence = "open app store"
pattern = re.compile(r'\b([a-z]) (?=[a-z]\b)', re.I)
sentence = re.sub(pattern, r'\g<1>', sentence)
print(sentence)
output:
open app store
I want to remove white space between app and store. I want output like this "open appstore".
Note that app won't always come up with store, app can come along with some other word after it, e.g. app maker.
open appstoreand notopenapp store?app storemay come anywhere in the string, how do you want to match it?app storecan come anywhere in sentence. I want to matchapp storestring in sentence and replace it withappstore.