From fbc2e9b0efdd751d6525f5ecfbcafd554ee58ba8 Mon Sep 17 00:00:00 2001 From: Stone Tickle Date: Wed, 29 Sep 2021 15:27:23 -0500 Subject: [PATCH] doc: document string.strip() optional argument [skip ci] --- docs/markdown/Syntax.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/markdown/Syntax.md b/docs/markdown/Syntax.md index 33b06cba5..897d55b83 100644 --- a/docs/markdown/Syntax.md +++ b/docs/markdown/Syntax.md @@ -253,6 +253,11 @@ s = s.replace('as', 'are') define = ' -Dsomedefine ' stripped_define = define.strip() # 'stripped_define' now has the value '-Dsomedefine' + +# You may also pass a string to strip, which specifies the set of characters to +# be removed. +string = 'xyxHelloxyx'.strip('xy') +# 'string' now has the value 'Hello' ``` #### .to_upper(), .to_lower()