protected final boolean checkStringEnd(String line,int index){
  int count=0;
  char[] arr=line.toCharArray();
  for (int i=index; i > 0; --i) {
    char c=arr[i];
    if (c == '\\')     ++count;
 else     break;
  }
  return count % 2 == 0;
}

protected final boolean checkStringEnd ( String line , int index ) { int count = 0 ; char [ ] arr = line . toCharArray ( ) ; for ( int i = index ; i > 0 ; -- i ) { char c = arr [ i ] ; if ( c == '\\' ) ++ count ; else break ; } return count % 2 == 0 ; }
check whether it ' s the string end . count the ` \ ` , check whether it % 2 = = 0
