-
-
Save ilpropheta/cbe87b69df98dc0fe5df4ad21fbb15ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string_view sv = name.GetString(); // GetString() returns a null-terminated const char* | |
sv.remove_prefix(std::min(v.find_first_not_of(" "), v.size())); // left trim | |
sv.remove_suffix(std::min(v.size()-v.find_last_not_of(" ")-1, v.size())); // right trim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment