From 9d3dad4d49e24121304f49c152b64560796b550f Mon Sep 17 00:00:00 2001 From: wangbx Date: Mon, 9 Oct 2017 22:56:02 +0800 Subject: [PATCH 1/2] add doc for strip, lstrip, rstrip --- docs/index.rst | 52 +++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 0218ad8..7a0b55c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -137,27 +137,35 @@ Dict 1 - - - >>> from pydu.structures import LookupDict - >>> d = LookupDict() - >>> d['key'] - None - >>> d['key'] = 1 - >>> d['key'] - 1 - - - - - >>> from pydu.structures import LookupDict - >>> d = LookupDict() - >>> d['key'] - None - >>> d['key'] = 1 - >>> d['key'] - 1 - - Utils ===== + +String +------ + +.. function:: pydu.utils.lstrips(text, remove) + + Removes the string `remove` from the left of `text`. + + >>> lstrips('foobar', 'foo') + 'bar' + >>> lstrips('FOOBARBAZ', ['FOO', 'BAR']) + 'BAZ' + >>> lstrips('FOOBARBAZ', ['BAR', 'FOO']) + 'BARBAZ' + + +.. function:: pydu.utils.rstrips(text, remove) + + Removes the string `remove` from the right of `text`. + + >>> rstrips('foobar', 'bar') + 'foo' + + +.. function:: pydu.utils.strips(text, remove) + + Removes the string `remove` from the both sides of `text`. + + >>> strips('foobarfoo', 'foo') + 'bar' From 2bc1a3a325d308d396eb6bbe55956bfbb3e982e6 Mon Sep 17 00:00:00 2001 From: Prodesire Date: Mon, 9 Oct 2017 22:59:22 +0800 Subject: [PATCH 2/2] empty --- docs/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.rst b/docs/index.rst index 7a0b55c..712016c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -169,3 +169,4 @@ String >>> strips('foobarfoo', 'foo') 'bar' +