updated trimString v2 to use #define