how to erase a index from string cpp code example
Example 1: remove or erase first and last character of string c++
str.pop_back(); // removes last /back character from str
str.erase(str.begin()); // removes first/front character from str
Example 2: delete one specific character in string C++
#include <algorithm>
str.erase(std::remove(str.begin(), str.end(), 'a'), str.end());