Index: include/core/SkString.h |
diff --git a/include/core/SkString.h b/include/core/SkString.h |
index e0a51c6515a59ffb511747e0c16be64f81a74054..ea73e0982389eba2e2fcf050b2485f608ea3c9a9 100644 |
--- a/include/core/SkString.h |
+++ b/include/core/SkString.h |
@@ -39,6 +39,12 @@ static int SkStrFind(const char string[], const char substring[]) { |
return SkToS32(first - &string[0]); |
} |
+static int SkStrFindLastOf(const char string[], const char subchar) { |
+ const char* last = strrchr(string, subchar); |
+ if (NULL == last) return -1; |
+ return SkToS32(last - &string[0]); |
+} |
+ |
static bool SkStrContains(const char string[], const char substring[]) { |
SkASSERT(string); |
SkASSERT(substring); |
@@ -152,6 +158,9 @@ public: |
int find(const char substring[]) const { |
return SkStrFind(fRec->data(), substring); |
} |
+ int findLastOf(const char subchar) const { |
+ return SkStrFindLastOf(fRec->data(), subchar); |
+ } |
friend bool operator==(const SkString& a, const SkString& b) { |
return a.equals(b); |