Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /tyvekzhang_fastlib /fastlib /utils /str_util.py
| # SPDX-License-Identifier: MIT | |
| """String utilities.""" | |
| def snake_to_title(snake_str: str) -> str: | |
| """Convert a snake_case string to a space-separated title-style string. | |
| Args: | |
| snake_str: A string in snake_case format. | |
| Returns: | |
| A string with each word capitalized and separated by spaces. | |
| Raises: | |
| TypeError: If the input is not a string. | |
| """ | |
| if not isinstance(snake_str, str): | |
| raise TypeError("Input must be a string") | |
| return " ".join( | |
| word for word in snake_str.strip("_").split("_") if word | |
| ).capitalize() | |
Xet Storage Details
- Size:
- 585 Bytes
- Xet hash:
- 222fa05c9d11f852c4b9bd191916ad437b3cb8a8eaee870695c8d52a8aa00e8a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.