How to use 'python remove character from string' in Python

Every line of 'python remove character from string' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
448def remove_control_characters(s):
449 if s is None:
450 return ''
451
452 s = unicode(s, "utf-8")
453 return "".join(ch for ch in s if unicodedata.category(ch)[0]!="C")
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets