code: private String replaceOrdinals(String value, String commaSeparatedList) {
          String[] list = StringUtils.commaDelimitedListToStringArray(commaSeparatedList);
          for (int i = 0; i < list.length; i++) {
              String item = list[i].toUpperCase();
              value = StringUtils.replace(value.toUpperCase(), item, Integer.toString(i));
          }
          return value;
      }
docs: Replace the values in the commaSeparatedList (case insensitive) with
  their index in the list.
  
  @param value the value
  @param commaSeparatedList the comma separated list
  @return a new string with the values from the list replaced