Added a function to get a range of characters from the TString object.

This commit is contained in:
2022-07-05 23:33:44 -05:00
parent ce4878e103
commit b1d79d7b7e
3 changed files with 54 additions and 5 deletions
+22
View File
@@ -78,6 +78,28 @@ int main(int argc, char** argv) {
continue;
}
if (input[0] == 'g') {
if (input[1] != '\0') {
printf("Select index: ");
fgets(input, sizeof input, stdin);
int num = strtol(input, NULL, 10);
printf("Enter count: ");
fgets(input, sizeof input, stdin);
int count = strtol(input, NULL, 10);
char* text = TStringGetStringRange(num, count, string);
printf("Returned String:\n'%s'\n", text);
free(text);
continue;
}
}
TStringAppendText(input, string);
}
//fgets(glyph, 10, stdin);