From 6419f93d5b8fcbfb0fc33e12329289a4eb1caf04 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Wed, 24 Feb 2016 17:31:57 +0300 Subject: [PATCH] Sync: + text --- utils/Sync/text/split.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 utils/Sync/text/split.py diff --git a/utils/Sync/text/split.py b/utils/Sync/text/split.py new file mode 100644 index 00000000..2af53f93 --- /dev/null +++ b/utils/Sync/text/split.py @@ -0,0 +1,6 @@ +def split(data, separator='\n\n'): + try: + s = data.index(separator) + return data[:s], data[s:] + except ValueError: + return data, None \ No newline at end of file