From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Returns True if the string begins with the value passed.


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

Part Type Description
result Boolean True if the stringVariable begins with the value passed.
stringVariable String Any variable of type String.
value String The String you are looking for.
options ComparisonOptions Determines if the comparison is case-sensitive or not.
locale Locale If provided, the locale is considered.


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


This example uses the BeginsWith function determine if the source string begins with "Inc.":

Var s As String
s = "Xojo, Inc."
If s.BeginsWith("Xojo", ComparisonOptions.CaseSensitive, Locale.Current) Then
MessageBox("It begins with Xojo.")
End If

See Also

String for a complete list of functions.