r""" Splits the given text at newline. >>> splitline('foo\nbar') ('foo\n', 'bar') >>> splitline('foo') ('foo', '') >>> splitline('') ('', '')
(text)
| 59 | |
| 60 | |
| 61 | def splitline(text): |
| 62 | r""" |
| 63 | Splits the given text at newline. |
| 64 | |
| 65 | >>> splitline('foo\nbar') |
| 66 | ('foo\n', 'bar') |
| 67 | >>> splitline('foo') |
| 68 | ('foo', '') |
| 69 | >>> splitline('') |
| 70 | ('', '') |
| 71 | """ |
| 72 | index = text.find("\n") + 1 |
| 73 | if index: |
| 74 | return text[:index], text[index:] |
| 75 | else: |
| 76 | return text, "" |
| 77 | |
| 78 | |
| 79 | class Parser: |
no outgoing calls
no test coverage detected