cdm/src/main/java/ucar/nc2/util/EscapeStrings.java
public static int indexOf(String escapedName, char c) {
    int pos = 0;
    while (true) {
      pos = escapedName.indexOf(c, pos + 1);
      if (pos <= 0) return pos;
      if ((pos > 0) && escapedName.charAt(pos - 1) != '\\') return pos;
    }
  }
public static int indexOf(String escapedName, char c) {
    int pos = 0;
    while (true) {
      pos = escapedName.indexOf(c, pos + 1);
      if (pos <= 0) return pos;
      if ((pos > 0) && escapedName.charAt(pos - 1) != '\\') return pos;
    }
  }
Find first occurence of char c in escapedName, excluding escaped c.

@param escapedName search in this string
@param c           for this char but not \\cha
@return pos in string, or -1