We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5c690c3 + c9287e5 commit 970be7aCopy full SHA for 970be7a
core/string/ustring.cpp
@@ -3665,7 +3665,9 @@ String String::left(int p_len) const {
3665
return *this;
3666
}
3667
3668
- return substr(0, p_len);
+ String s;
3669
+ s.copy_from_unchecked(&get_data()[0], p_len);
3670
+ return s;
3671
3672
3673
String String::right(int p_len) const {
@@ -3681,7 +3683,9 @@ String String::right(int p_len) const {
3681
3683
3682
3684
3685
- return substr(length() - p_len);
3686
3687
+ s.copy_from_unchecked(&get_data()[length() - p_len], p_len);
3688
3689
3690
3691
char32_t String::unicode_at(int p_idx) const {
0 commit comments