I have a vector of chars:
std::vector<char> V = {'A', 'B', 'C', 'D'};
How can I extract a substring from this vector? For example, I want to get an "ABC" value of type std::string
. What is the most efficient way?
I also would like to avoid copying data as I'm not going to modify the string.