feat: add string utility.

This commit is contained in:
2025-01-30 02:21:25 +08:00
parent 4eb070db7e
commit 58d6f92802

View File

@@ -0,0 +1,18 @@
"""
String Utiltiy
"""
def startswith_m(con: str, *args) -> bool:
for arg in args:
if con.startswith(arg):
return True
return False
def find_m(con: str, *args) -> int:
for arg in args:
pos = con.find(arg)
if pos != -1:
return pos, arg
return -1