ChatDev/utils/strs.py
2026-01-07 16:24:01 +08:00

5 lines
210 B
Python
Executable File

def titleize(value: str) -> str:
sanitized = value.replace("_", " ").replace("-", " ").strip()
if not sanitized:
return value
return " ".join(part.capitalize() for part in sanitized.split())