Preparation for <string_view>. More helper functions that can be shared between <string> and <string_view>. No functionality change