Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mystr = r'''documentclass[12pt]{article}
- usepackage{amsmath}
- title{LaTeX}
- begin{document}
- section{Introduction}
- This is introduction paragraph
- section{Non-Introduction}
- This is non-introduction paragraph
- section{Sample section}
- This is sample section paragraph
- end{document}'''
- ['This is introduction paragraph','This is non-introduction paragraph',' This is sample section paragraph']
- my_string = "a quick brown fox jumps over a lazy dog than a quick elephant"
- word = "a "
- my_string.split(word)
- ['', 'quick brown fox jumps over ', 'lazy dog than ', 'quick elephant']
- import re
- str_ = "a quick brown fox jumps over a lazy dog than a quick elephant"
- print(re.split(r's?babs?',str_))
- # ['', 'quick brown fox jumps over', 'lazy dog than', 'quick elephant']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement