Created
December 23, 2019 07:38
-
-
Save sagorbrur/8a919ed2faa95ebcc1f970b96f871f26 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 = "I live in Bangladesh.\n\n\nBangladesh is a beautiful country.\n\nI love my country." | |
res = re.sub(r'\n+', '\n',text) | |
print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment