MCPcopy Create free account
hub / github.com/webpy/webpy / strips

Function strips

web/utils.py:343–351  ·  view source on GitHub ↗

removes the string `remove` from the both sides of `text` >>> strips("foobarfoo", "foo") 'bar'

(text, remove)

Source from the content-addressed store, hash-verified

341
342
343def strips(text, remove):
344 """
345 removes the string `remove` from the both sides of `text`
346
347 >>> strips("foobarfoo", "foo")
348 'bar'
349
350 """
351 return rstrips(lstrips(text, remove), remove)
352
353
354def safestr(obj, encoding="utf-8"):

Callers

nothing calls this directly

Calls 2

rstripsFunction · 0.85
lstripsFunction · 0.85

Tested by

no test coverage detected