Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/core/utils/text.py
2023-04-23 18:32:19 +08:00

7 lines
218 B
Python

def remove_suffix(string, suffix):
return string[:-len(suffix)] if string.endswith(suffix) else string
def remove_prefix(string, prefix):
return string[len(prefix):] if string.startswith(prefix) else string