Add trim to ZString.

This commit is contained in:
Brad Arant committed 2024-09-24 11:14:58 -07:00
1 parent a1cc142a59
commit d7ef47cd49
3 files changed
+14

No files matched your search

+5
View File
@@ -397,6 +397,11 @@ namespace coreutils {
return ZString(temp, tempend - temp);
}
ZString ZString::trim() {
skipWhitespace();
return unparsed();
}
int ZString::find(ZString comparator) {
int count = 0;
char *temp = cursor;
+6
View File
@@ -322,6 +322,12 @@ namespace coreutils {
ZString goeol();
///
///
///
ZString trim();
///
/// Return a block of data as a ZString from the cursor location for
/// the number of bytes specified by size.
+3
View File
@@ -92,4 +92,7 @@ int main(int argc, char **argv) {
std::cout << test16.substring(0, 7) << std::endl;
std::cout << test16.substring(18, 20) << std::endl;
coreutils::ZString test17(" hello there ");
std::cout << "[" << test17.trim() << "]" << std::endl;
}