+// Returns the number of characters that are in common between
+// String1 and String2 before they diverge. For instance, if
+// String1 is "FooBar" and String2 is "FoodiesBar", this function
+// will return "3", since they both start with "Foo".
+UINTN NumCharsInCommon(IN CHAR16* String1, IN CHAR16* String2) {
+ UINTN Count = 0;
+ if ((String1 == NULL) || (String2 == NULL))
+ return 0;
+ while ((String1[Count] != L'\0') && (String2[Count] != L'\0') && (String1[Count] == String2[Count]))
+ Count++;
+ return Count;
+} // UINTN NumCharsInCommon()
+