text: public static int compareArray(char[] larray, int lstartIndex, char[] rarray,int rstartIndex) {if (larray == null) {if (rarray == null || rstartIndex >= rarray.length)return 0;else return -1;} else {if (rarray == null) {if (lstartIndex >= larray.length)return 0;else return 1;}}int li = lstartIndex, ri = rstartIndex;while (li < larray.length && ri < rarray.length && larray[li] == rarray[ri]) {li++;ri++;}if (li == larray.length) {if (ri == rarray.length) {return 0;} else {return -1;}} else {if (ri == rarray.length) {return 1;} else {if (larray[li] > rarray[ri])return 1;else return -1;}}}