Using boost::trim_left_if to only trim whitespaces, to avoid if (s[0] != ' ').