mSelectedPlace = 1 && first position in a substr mEndPlace = 1 && position to set in a substr DO WHILE mOK = .f. mSelectedCharacter = "" && will hold a char mSelectedCharacter = SUBSTR(mFeeApproved,mSelectedPlace,mEndPlace) IF mSelectedCharacter = "0" DELETE SUBSTR(mFeeApproved,mSelectedPlace,mEndPlace) && code fails here! mSelectedPlace = mSelectedPlace + 1 mEndPlace = mEndPlace+1 LOOP ELSE EXIT ENDIF enddoThe idea is to check the first char in the string, and if it is a zero, delete it from the variable mFeeApproved. Then loop to the check the next position till no more chars are left in that string to be evaluated.