From 6bfc78ec498343fb2c42e0c3de5f4be203e5b3d5 Mon Sep 17 00:00:00 2001 From: Relintai Date: Fri, 19 Nov 2021 22:38:31 +0100 Subject: [PATCH] get_slice_count should return 1 by default. --- core/string.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/string.cpp b/core/string.cpp index 8b05b05..e44d9e6 100644 --- a/core/string.cpp +++ b/core/string.cpp @@ -369,7 +369,7 @@ int String::get_slice_count(const char splitter) const { return count; } int String::get_slice_count(const String &splitter) const { - int count = 0; + int count = 1; int n = find(splitter, n); while (n != -1) {