Commit 2d75b4bf authored by zaur's avatar zaur

Add support for unicode slicing

parent de667b62
# coding=utf-8
__doc__ = u"""
>>> do_slice(u'abcdef', 2, 3)
(u'c', u'cdef', u'ab', u'abcdef')
>>> do_slice(u'abcdef', 0, 5)
(u'abcde', u'abcdef', u'', u'abcdef')
"""
import sys
if sys.version_info[0] >= 3:
__doc__ = __doc__.replace(u"(u'", u"('").replace(u" u'", u" '")
def do_slice(unicode s, int i, int j):
return s[i:j], s[i:], s[:i], s[:]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment