mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-05-06 17:51:36 +02:00
fix get_slice.
This commit is contained in:
parent
4acfa61f58
commit
38b95e4ac8
@ -380,6 +380,10 @@ int String::get_slice_count(const String &splitter) const {
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
String String::get_slice(const char splitter, int index) {
|
String String::get_slice(const char splitter, int index) {
|
||||||
|
if (_size == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
int start_index = 0;
|
int start_index = 0;
|
||||||
@ -398,13 +402,13 @@ String String::get_slice(const char splitter, int index) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return substr_index(start_index, _size - 1);
|
return substr_index(start_index, _size - 1);
|
||||||
}
|
}
|
||||||
String String::get_slice(const String &splitter, int index) {
|
String String::get_slice(const String &splitter, int index) {
|
||||||
|
if (_size == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
int start_index = 0;
|
int start_index = 0;
|
||||||
@ -423,10 +427,6 @@ String String::get_slice(const String &splitter, int index) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
return substr_index(start_index, _size - 1);
|
return substr_index(start_index, _size - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user