Index: src/core/SkString.cpp |
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp |
index e30b89f19947dd667648b13a86a06c32e86bd79c..643dfb13727449247a525eee12b6bfb3ad002088 100644 |
--- a/src/core/SkString.cpp |
+++ b/src/core/SkString.cpp |
@@ -634,5 +634,17 @@ SkString SkStringPrintf(const char* format, ...) { |
return formattedOutput; |
} |
+void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out) { |
+ const char* end = str + strlen(str); |
+ while (str != end) { |
+ // Find a token. |
+ const size_t len = strcspn(str, delimiters); |
+ out->push_back().set(str, len); |
+ str += len; |
+ // Skip any delimiters. |
+ str += strspn(str, delimiters); |
+ } |
+} |
+ |
#undef VSNPRINTF |
#undef SNPRINTF |