From 410b33edd28826fe67bf797e110e70945384b987 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 18 Nov 2024 17:58:14 +0100 Subject: [PATCH] added starts_with --- util.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util.cpp b/util.cpp index 2f160eb1..2b1c666c 100644 --- a/util.cpp +++ b/util.cpp @@ -1079,6 +1079,11 @@ EX string eval_programmable_string(const string& fmt) { } } +EX bool starts_with(const char *c, const char *token) { + while(*token && *c == *token) c++, token++; + return !*token; + } + EX void floyd_warshall(vector>& v) { int N = isize(v); for(int k=0; k