Files
Crm-Backend/utils/strings.py
2025-09-01 17:54:45 +04:00

9 lines
190 B
Python

import re
from typing import Optional
def camel_to_snake(string: Optional[str]) -> str:
if not string:
return string
return re.sub(r"(?<!^)(?=[A-Z])", "_", string).lower()