Min_(A: String; B: String): String;
A. The first string to compare.
B. The second string to compare.
The Min_ method compares two strings character-by-character and returns the minimum one of them.
Strings are compared by value of the ASCII case-sensitive encoding. For example:
When comparing the abcde and abc strings, the second string will be the minimum one. The second string length is less than length of the first one.
When comparing the Abc and abc strings, the second string will be the minimum one. The ASCII encoding value for the a character is less than for A.
The method returns Null if at least one of parameters is equal to Null.
Sub UserProc;
Var
s1, s2, s3: String;
Begin
s1 := "Apple";
s2 := "Banana";
// Get minimum of two strings
s3 := String.Min_(s1, s2);
Debug.WriteLine("Min_(""" + s1 + """" + ", """ + s2 + """" + ") = " + s3);
End Sub UserProc;
After executing the example the minimum string of the Apple and Banana strings is displayed in the console window.
See also: