Is there any way to trim everything after a given character, let's say '_' . Is there any way to do that? Example:
string ul = "The quick brown fox jumped over the lazy dog________ dog dog" int ullocation = ul.find("_") (code to remove everything after the underline using the int)
ul = ul.substr(...)?std::string::erasedoes exactly what you want: en.cppreference.com/w/cpp/string/basic_string/erase