Best method to trim left/right a string in C?
Hello,
I am employing usually the following function: Trim is really useful and important if you programme in C. There are usually the need to trim configuration files, to let the programme explore the content of user settings. Code:
char *trim(char *str) You can share your experience with trim. |
I'm really still not sure exactly what you are trying to do here... get rid of everything before the first whitespace and after the last?
|
You might want to take look at strtok(3) if this is about parsing user options:
Code:
test@ws1:/tmp$ cat strtok.c |
All times are GMT -5. The time now is 06:26 PM. |