From e26da7c37e81073600041557003a7d5824562f3b Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 20 Jun 2019 21:41:19 -0700 Subject: [PATCH] stringBeginEq --- util/StringUtil.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/StringUtil.hh b/util/StringUtil.hh index 1954c54f..d98b33d8 100644 --- a/util/StringUtil.hh +++ b/util/StringUtil.hh @@ -50,6 +50,14 @@ stringEqIf(const char *str1, || (str1 && str2 && strcmp(str1, str2) == 0); } +// Case sensitive compare the beginning of str1 to str2. +inline bool +stringBeginEq(const char *str1, + const char *str2) +{ + return strncmp(str1, str2, strlen(str2)) == 0; +} + // Case insensitive compare the beginning of str1 to str2. inline bool stringBeginEqual(const char *str1,