String.EndsWith

From Xojo Documentation

Method

Returns True if the string ends with the value passed.

Syntax

result=stringVariable.EndsWith(value As String, options As ComparisonOptions = ComparisonOptions.CaseInsensitive, locale As Locale = Nil)

Part Type Description
result Boolean True if the stringVariable ends with the value passed.
stringVariable String Any variable of type String.
value String The value to be compared to the contents of the stringVariable.
options ComparisonOptions Determines if the comparison of the stringVariable and value parameters will be case-sensitive or case-insensitive (the default).
locale Locale The Locale to be considered for the comparison.

Notes

EndsWith tells you whether or not the source string ends with the value passed based upon the comparison option (case-sensitive or case-insensitive) and locale specified.

Examples

This example uses the EndsWith function determine if the source string ends with "Inc.":

Var source As String
source = "Xojo, Inc."
If source.EndsWith("Inc.", ComparisonOptions.CaseSensitive, Locale.Current) then
System.Beep
MessageBox("It ends with Inc.")
End If

See Also

String for a complete list of functions.