
please wait
|
|
if (line.length() > 0)
if(line != "") ...
to ignore empty lines, though that won't work if there is a space on that line.infile >> ws;//needs <iomanip>
before getline to ignore any white spaces, but this will also remove spaces (up to the first non space) from lines that contain text.bool isNotJustSpaces(string str)
. Simply iterate through the given string and if any char is not ' ' or '\t' (tab), return true.