This works, if just loops through till it doesn't find a space or tab than counts the index at that point then uses substr to get rid of any spaces/tabs, it's a small function and uses a goto I am just wondering how you would do it?
Code:
string trimLeft(string lineOfCodeToTrim){
string l = lineOfCodeToTrim;
int k =0;
for(UINT i = 0;i<l.length();i++){
//FIXME: Just need l[i] != ' ' && l[i] != '\t";
if(((int)l[i] < 32 || (int)l[i] > 32) && ((int)l[i] != 9)){
goto l1;
}
k++;
}
l1:
if(k > 0){
l = l.substr(k ,lineOfCodeToTrim.length() - k);
}
return l;
}