Skip to content

String.Includes

boxgaming edited this page Aug 5, 2025 · 5 revisions

Performs a case-sensitive search to determine whether a given string may be found within this string, returning true (-1) or false (0) as appropriate.

Syntax

result = String.Includes (s$, searchStr$)

Parameters

  • The s$ parameter contains the string to search.
  • The searchString$ parameter contains the string to search for within s$.

Example

Import String From "lib/lang/string.bas"

Dim s As String
s = "The quick brown fox jumped over the lazy dog."

Print "Includes 'fox'    "; String.Includes(s, "fox")
Print "Includes 'wolf'   "; String.Includes(s, "wolf")

Output

Includes 'fox'    -1
Includes 'wolf'   0

See Also

String.StartsWith
String.EndsWith
Javascript - String.includes()

Clone this wiki locally