EndsWith_(Source: String; SubStr: String): Boolean;
Source. Source string.
SubStr. Search substring.
The EndsWith_ method determines whether the end of source string contains search substring.
Available values:
True. Source string ends with search substring.
False. Source string does not end with search substring.
Search for search substring in source string is case-sensitive. Spaces at the end of string and substring are ignored.
Sub UserProc;
Var
s1, s2: String;
b: Boolean;
Begin
s1 := "Calculator";
s2 := "tor";
// Check if the end of source string contains substring
b := String.EndsWith_(s1, s2);
Debug.WriteLine("EndsWith_(""" + s1 + "; " + s2 + """) = " + b.ToString);
End Sub UserProc
After executing the example it is determined whether the end of the Calculator string contains the tor substring, and the result is displayed in the console window.
See also: