If I have:
vector<string> line(k)
Which each line can essentially be anything and k is some user specified thing, how would I go about creating a new vector of strings from this that only contains words?
For example, say the input was:
The way I have coded my program now, each line is a string in vector<string> line.Code:This is a reaaally annoying test I have to do and I really don't get it at all
I am trying to create a new vector that instead contains:
The reason I ask is because I need to find a way to remove the trailing spaces from the input. In addition, I also have to make each line of output 30 characters, or start a new line if adding in one more word would put the line over the limit.Code:This is a reaaally annoying etc. etc.
I can provide any clarification if necessary.