0

I have a paragraph with some spaces and special characters and "....." 's.

I would like to know if there is any function in python which helps in splitting the lines in the paragraph with specified delimiters like "...."

Thanks in advance

Eliahu Aaron
  • 4,103
  • 5
  • 27
  • 37
  • 6
    Possible duplicate of [Split string with multiple delimiters in Python](https://stackoverflow.com/questions/4998629/split-string-with-multiple-delimiters-in-python) – Eliahu Aaron Nov 07 '19 at 14:20

1 Answers1

2

Multiple ways to do this:

  1. string.split will return a list of lines and then string.join to form the sentences. split
input = # Your paragraph
input.split('...')  # will return a list of lines
''.join(input) # will return a set of lines
  1. regex.split likewise will return a list of lines (recommended) regex split
re.split(r'\.\.\.', input)