string: factorize skip_spaces and export it to be generally available