Completed cosing of substring.

This commit is contained in:
Brad Arant committed 2024-08-08 11:42:09 -07:00
1 parent 39fd88cad9
commit a1cc142a59
2 files changed
+13 -1

No files matched your search

+7
View File
@@ -171,6 +171,13 @@ namespace coreutils {
}
ZString ZString::substring(int start, int len) {
char *end = data + length;
char *startChar = data + start;
char *endChar = startChar + len;
char newlen = endChar > end ? endChar - end: len;
if(startChar < end) {
return ZString(startChar, newlen);
}
return ZString();
}