Skip to content

Commit 410b33e

Browse files
committed
added starts_with
1 parent 0137175 commit 410b33e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

util.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,11 @@ EX string eval_programmable_string(const string& fmt) {
10791079
}
10801080
}
10811081

1082+
EX bool starts_with(const char *c, const char *token) {
1083+
while(*token && *c == *token) c++, token++;
1084+
return !*token;
1085+
}
1086+
10821087
EX void floyd_warshall(vector<vector<char>>& v) {
10831088
int N = isize(v);
10841089
for(int k=0; k<N; k++)

0 commit comments

Comments
 (0)