which command is used to clear a string variable in c++ code example Example: how to clear a string in c++ str.clear();