MCPcopy Index your code
hub / github.com/pyload/pyload / remove_chars

Function remove_chars

module/plugins/internal/misc.py:501–514  ·  view source on GitHub ↗

Remove all chars in repl from string

(value, repl)

Source from the content-addressed store, hash-verified

499
500
501def remove_chars(value, repl):
502 """
503 Remove all chars in repl from string
504 """
505 if isinstance(repl, unicode):
506 for badc in list(repl):
507 value = value.replace(badc, "")
508 return value
509
510 elif isinstance(value, unicode):
511 return value.translate(dict((ord(s), None) for s in repl))
512
513 elif isinstance(value, str):
514 return value.translate(string.maketrans("", ""), repl)
515
516
517def fixurl(url, unquote=None):

Callers 2

safenameFunction · 0.70
_overrideMethod · 0.70

Calls 2

dictFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected