|
@ -12,4 +12,13 @@ void trimLeft(char *input) { |
|
|
for (int i = 0; i <= length - firstIndex; i++) { |
|
|
for (int i = 0; i <= length - firstIndex; i++) { |
|
|
input[i] = input[firstIndex + i]; |
|
|
input[i] = input[firstIndex + i]; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void trimRight(char *input) { |
|
|
|
|
|
size_t length = strlen(input); |
|
|
|
|
|
int index = length - 1; |
|
|
|
|
|
while (index >= 0 && isspace(input[index])) { |
|
|
|
|
|
input[index] = '\0'; |
|
|
|
|
|
index--; |
|
|
|
|
|
} |
|
|
} |
|
|
} |