summaryrefslogtreecommitdiff
path: root/decoder/stringlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/stringlib.h')
-rw-r--r--decoder/stringlib.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/decoder/stringlib.h b/decoder/stringlib.h
index 76efee8f..22863945 100644
--- a/decoder/stringlib.h
+++ b/decoder/stringlib.h
@@ -36,6 +36,13 @@ inline void Tokenize(const std::string& str, char delimiter, std::vector<std::st
res->push_back(&s[last]);
}
+inline unsigned NTokens(const std::string& str, char delimiter)
+{
+ std::vector<std::string> r;
+ Tokenize(str,delimiter,&r);
+ return r.size();
+}
+
inline std::string LowercaseString(const std::string& in) {
std::string res(in.size(),' ');
for (int i = 0; i < in.size(); ++i)