예제 #1
0
 /// <summary>
 /// Compares the two specified strings.
 /// </summary>
 /// <param name="strA">The first string to compare</param>
 /// <param name="strB">The second string to compare</param>
 /// <returns>0 if both strings are null or they are equal; a negative number if strA is null or
 /// is lexicographically before strB; a positive number otherwise</returns>
 public static int Compare(Utf32String strA, Utf32String strB)
 {
     if (object.ReferenceEquals(strA, strB))
     {
         return(0);
     }
     if ((object)strA == null || (object)strB == null)
     {
         return((object)strA == null ? -1 : 1);
     }
     return(strA.CompareTo(strB));
 }
예제 #2
0
		/// <summary>
		/// Compares the two specified strings.
		/// </summary>
		/// <param name="strA">The first string to compare</param>
		/// <param name="strB">The second string to compare</param>
		/// <returns>0 if both strings are null or they are equal; a negative number if strA is null or
		/// is lexicographically before strB; a positive number otherwise</returns>
		public static int Compare(Utf32String strA, Utf32String strB)
		{
			if (object.ReferenceEquals(strA, strB))
			{
				return 0;
			}
			if ((object)strA==null || (object)strB==null)
			{
				return ((object)strA==null ? -1 : 1);
			}
			return strA.CompareTo(strB);
		}