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 ; }
Gets the index of the longest NCName that is the suffix of a character sequence .