diff options
Diffstat (limited to 'include/cru/common/String.hpp')
-rw-r--r-- | include/cru/common/String.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/cru/common/String.hpp b/include/cru/common/String.hpp index 86e0a134..0ae223cf 100644 --- a/include/cru/common/String.hpp +++ b/include/cru/common/String.hpp @@ -165,7 +165,10 @@ class CRU_BASE_API String { } inline void append(StringView str); - String substr(size_type start, size_type size) const { + String substr(size_type start, size_type size = -1) const { + if (size == -1) { + size = this->size_ - start; + } return String(this->buffer_ + start, size); } @@ -189,6 +192,9 @@ class CRU_BASE_API String { std::vector<String> SplitToLines(bool remove_space_line = false) const; + bool StartWith(StringView str) const; + bool EndWith(StringView str) const; + public: void AppendCodePoint(CodePoint code_point); |