public String removeMask(String mask,String value){
  if (mask == null || value == null) {
    return null;
  }
  value=applyMask(mask,value);
  String newValue="";
  Integer isInMask=0;
  Integer index=0;
  for (Integer i=0; i < mask.length(); i++) {
    Character maskCharacter=mask.charAt(i);
    if (maskCharacter.equals('}')) {
      isInMask--;
    }
 else     if (maskCharacter.equals('{')) {
      isInMask++;
    }
 else {
      if (isInMask == 2) {
        if (index >= value.length()) {
          break;
        }
        newValue+=value.charAt(index);
      }
      index++;
    }
  }
  return newValue;
}

public String removeMask ( String mask , String value ) { if ( mask == null || value == null ) { return null ; } value = applyMask ( mask , value ) ; String newValue = "" ; Integer isInMask = 0 ; Integer index = 0 ; for ( Integer i = 0 ; i < mask . length ( ) ; i ++ ) { Character maskCharacter = mask . charAt ( i ) ; if ( maskCharacter . equals ( '}' ) ) { isInMask -- ; } else if ( maskCharacter . equals ( '{' ) ) { isInMask ++ ; } else { if ( isInMask == 2 ) { if ( index >= value . length ( ) ) { break ; } newValue += value . charAt ( index ) ; } index ++ ; } } return newValue ; }
removes the mask on a given value
