code: private static int nextSep(String desc, int pos) {
          int pos2 = desc.length();  // assume we'll find none
          int candidate = desc.indexOf('+', pos);
          if (candidate > 0) {
              pos2=candidate;
          }
  
          candidate = desc.indexOf('-', pos);
          if (candidate>0) {
              pos2 = Math.min(candidate, pos2);
          }
  
          candidate = desc.indexOf('~', pos);
          if (candidate>0) {
              pos2 = Math.min(candidate, pos2);
          }
          return pos2;
      }
docs: Find the first subsequent occurrance of '+', '-', or '~' in the string
  or the end of line if none are there
  @param desc string to search
  @param pos starting position in string
  @return position of next separator, or end of string if none present