String.Max_

Syntax

Max_(A: String; B: String): String;

Parameters

A. The first string to compare.

B. The second string to compare.

Description

The Max_ method compares two strings character-by-character and returns the maximum one of them.

Comments

Strings are compared by value of the ASCII case-sensitive encoding. For example:

The method returns Null if at least one of parameters is equal to Null.

Example

Sub UserProc;
Var
    s1, s2, s3: String;
Begin
    s1 := 
"Apple";
    s2 := 
"Banana";
    
// Get the maximum string of two strings
    s3 := String.Max_(s1, s2);

    Debug.WriteLine("Max_(""" + s1 + """" + ", """ + s2 + """" + ") = " + s3);
End Sub UserProc

After executing the example the maximum string of the Apple and Banana strings is displayed in the console window.

See also:

String