Remove all chars in repl from string
(value, repl)
| 499 | |
| 500 | |
| 501 | def 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 | |
| 517 | def fixurl(url, unquote=None): |