mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
test file for init optimization example
This commit is contained in:
parent
9708f532e9
commit
8d5e90c741
1 changed files with 10 additions and 0 deletions
10
code_to_optimize/remove_control_chars.py
Normal file
10
code_to_optimize/remove_control_chars.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import re
|
||||
|
||||
|
||||
class CharacterRemover:
|
||||
def __init__(self):
|
||||
self.version = "0.1"
|
||||
|
||||
def remove_control_characters(self, s) -> str:
|
||||
"""Remove control characters from the string."""
|
||||
return re.sub("[\\x00-\\x1F\\x7F]", "", s) if s else ""
|
||||
Loading…
Reference in a new issue