#include #include "stringx.h" const char* trim_start(const char* data) { while(*data && isspace(*data)) ++data; return data; } char* trim_end(char* data) { char* t = data + strlen(data); while(t > data && isspace(*(t - 1))) { t--; *t = 0; } return data; } char* trim_space(char* data) { data = (char*)trim_start(data); return trim_end(data); }