strip_null¶
-
privex.helpers.common.
strip_null
(value: Union[str, bytes], conv: Callable[[str], Union[str, bytes, T]] = <function stringify>, nullc='\x00') → Union[str, bytes, T][source]¶ Small convenience function which
stringify()
’svalue
then strips it of whitespace and null bytes, with two passes for good measure.- Parameters
value (str|bytes) – The value to clean whitespace/null bytes out of
conv (callable) – (Default
stringify()
) Optionally, you can override the casting function used after the stripping is completednullc (str) – (Default:
\
) Null characters to remove
- Return str|bytes|T cleaned
The cleaned up
value