code: public static int getNCNameSuffixIndex(CharSequence s) {
          // identify bnode labels and do not try to split them
          if (s.length() > 1 && s.charAt(0) == '_' && s.charAt(1) == ':') {
              return -1;
          }
          int index = -1;
          for (int i = s.length() - 1; i > -1; i--) {
              if (!Character.isLowSurrogate(s.charAt(i))) {
                  int codePoint = Character.codePointAt(s, i);
                  if (isNCNameStartChar(codePoint)) {
                      index = i;
                  }
                  if (!isNCNameChar(codePoint)) {
                      break;
                  }
              }
          }
          return index;
      }
docs: Gets the index of the longest NCName that is the suffix of a character
  sequence.
  
  @param s
  The character sequence.
  @return The index of the longest suffix of the specified character
  sequence {@code s} that is an NCName, or -1 if the character
  sequence {@code s} does not have a suffix that is an NCName.