RosettaCodeData/Task/String-matching/Gambas/string-matching.gambas

10 lines
490 B
Plaintext

Public Sub Main()
Dim sString1 As String = "Hello world"
Dim sString2 As String = "Hello"
Print sString1 Begins Left(sString2, 5) 'Determine if the first string starts with second string
If InStr(sString1, sString2) Then Print "True" Else Print "False" 'Determine if the first string contains the second string at any location
Print sString1 Ends Left(sString2, 5) 'Determine if the first string ends with the second string
End