text: public static int CompareArrayByPrefix(char[] shortArray, int shortIndex,char[] longArray, int longIndex){if (shortArray == null)return 0;else if (longArray == null)return (shortIndex < shortArray.Length) ? 1 : 0;int si = shortIndex, li = longIndex;while (si < shortArray.Length && li < longArray.Length&& shortArray[si] == longArray[li]){si++;li++;}if (si == shortArray.Length){return 0;}else{if (li == longArray.Length)return 1;else return (shortArray[si] > longArray[li]) ? 1 : -1;}}