Browse Source

implemented trimLeft

remotes/origin/userinput
TheUltimateOptimist 11 months ago
parent
commit
daa595a322
  1. 16
      src/userinput.c

16
src/userinput.c

@ -1 +1,15 @@
#include "userinput.h"
#include "userinput.h"
#include <ctype.h>
#include <stdio.h>
void trimLeft(char *input) {
size_t length = strlen(input);
int firstIndex = 0;
while (firstIndex < length && isspace(input[firstIndex])) {
firstIndex++;
}
for (int i = 0; i <= length - firstIndex; i++) {
input[i] = input[firstIndex + i];
}
}
Loading…
Cancel
Save