-
- while (estim.find_first_of('-') != -1) {
- individual = estim.substr(0,estim.find_first_of('-'));
- if ((estim.find_first_of('-')+1) <= estim.length()) { //checks to make sure you don't have dash at end of string
- estim = estim.substr(estim.find_first_of('-')+1, estim.length());
- convert(individual, lineNum); //convert the string to int
- container.insert(lineNum);
+ int estimLength = estim.size();
+ bool prevEscape = false;
+ for(int i=0;i<estimLength;i++){
+ if(prevEscape){
+ individual += estim[i];
+ prevEscape = false;
+ }
+ else{
+ if(estim[i] == '\\'){
+ prevEscape = true;
+ }
+ else if(estim[i] == '-'){
+ convert(individual, lineNum); //convert the string to int
+ container.insert(lineNum);
+ individual = "";
+ prevEscape = false;
+ }
+ else{
+ individual += estim[i];
+ prevEscape = false;
+ }