#includevoid removeWhitespace(std::string& str) { str.erase(remove(str.begin(), str.end(), ' '), str.end()); }
#includeIn this example, the `erase` function is used to remove a single character from the string at the specified index. The deleteChar function is part of the standard C++ library, included in the `string` header file.void removeCharAtIndex(std::string& str, int index) { str.erase(index, 1); }