diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-24 08:32:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-24 08:32:42 +0200 |
commit | aa062c54fcdac6a17e38f3678c886779bce325f9 (patch) | |
tree | c578a84dd1fd8285a5250ebfe8907494b02ff5a1 /core/ustring.h | |
parent | 3cbd4337ce5bd3d589cd96e1a371d417be781841 (diff) | |
parent | 080c0bb7fea824f231e8972fe1e7f82290a2f453 (diff) |
Merge pull request #25090 from Chaosus/string_count
Added String.count method
Diffstat (limited to 'core/ustring.h')
-rw-r--r-- | core/ustring.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/ustring.h b/core/ustring.h index 8a52c53238..3eb5c47b3a 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -137,6 +137,7 @@ class String { void copy_from(const CharType &p_char); void copy_from_unchecked(const CharType *p_char, const int p_length); bool _base_is_subsequence_of(const String &p_string, bool case_insensitive) const; + int _count(const String &p_string, int p_from, int p_to, bool p_case_insensitive) const; public: enum { @@ -279,6 +280,9 @@ public: String to_upper() const; String to_lower() const; + int count(const String &p_string, int p_from = 0, int p_to = 0) const; + int countn(const String &p_string, int p_from = 0, int p_to = 0) const; + String left(int p_pos) const; String right(int p_pos) const; String dedent() const; |