wms-py/app/utils/string_utils.py

15 lines
374 B
Python
Raw Normal View History

2025-06-04 10:39:32 +08:00
def pad_left(text: str, pad_char: str = "0", length: int = 2) -> str:
return text.rjust(length, pad_char)
def pad_right(text: str, pad_char: str = " ", length: int = 10) -> str:
return text.ljust(length, pad_char)
def is_empty(text: str) -> bool:
return text is None or text.strip() == ""
def is_not_empty(text: str) -> bool:
return not is_empty(text)