public static int strcmp(String str,char[] a,int start){
  int i;
  int d;
  int len=str.length();
  for (i=0; i < len; i++) {
    d=(int)str.charAt(i) - a[start + i];
    if (d != 0) {
      return d;
    }
    if (a[start + i] == 0) {
      return d;
    }
  }
  if (a[start + i] != 0) {
    return -a[start + i];
  }
  return 0;
}

public static int strcmp ( String str , char [ ] a , int start ) { int i ; int d ; int len = str . length ( ) ; for ( i = 0 ; i < len ; i ++ ) { d = ( int ) str . charAt ( i ) - a [ start + i ] ; if ( d != 0 ) { return d ; } if ( a [ start + i ] == 0 ) { return d ; } } if ( a [ start + i ] != 0 ) { return - a [ start + i ] ; } return 0 ; }
compares a string with null terminated char array
