Skip to content

Modern String InstrChars

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › String Library › String Library › InstrChars

InstrChars

Returns the position of the first character from a set, or 0.

Syntax

InstrChars( start, s, chars [, ic] )

Notes

  • O(n*k) — long

Examples

#import "std/strings"
using strings

dim as ustring s = "name = value"

print InstrChars( 1, s, "=:" )       '' 6 -- first of either delimiter
print InstrChars( 7, s, "=:" )       '' 0 -- none from position 7 on
print InstrChars( 1, s, "" )         '' 0 -- an empty set cannot match
print InstrChars( 0, s, "=:" )       '' 0 -- a start below 1 answers 0

Library: String Library
Category: String Library
Documented under: The Functions

Clone this wiki locally