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;}}}