We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
starts_with
1 parent 273b6c0 commit 9322334Copy full SHA for 9322334
python/selfie-lib/selfie_lib/Slice.py
@@ -89,3 +89,8 @@ def count(self, char: str) -> int:
89
90
def baseLineAtOffset(self, index: int) -> int:
91
return 1 + Slice(self.base, 0, index).count("\n")
92
+
93
+ def starts_with(self, prefix: str) -> bool:
94
+ if len(prefix) > len(self):
95
+ return False
96
+ return all(self[i] == prefix[i] for i in range(len(prefix)))
0 commit comments