STRCHR

From STX Wiki
< Programmer Guide‎ | Command Reference
Revision as of 14:05, 17 May 2010 by 193.171.195.8 (talk) (initial import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

STRCHR

var := STRCHR [ /R ] [ /S ] [ /V ] /- characters string

var := STRCHR [ /R ] [ /S ] /V /- characters variable

-> var = the index of the first occurrence or -1

Locates the first occurrence of the character character, or one of the characters in character in the string string or the variable variable. and returns the index of the first occurrence, or -1, if no occurrence is found.

/R
If option /R is supplied, the string will be searched from right to left; otherwise, it will be searched from left to right.
/S
If option /S is set, warnings instead of errors will be generated on failure
string
A string of characters to search for.
character
A single character to search for.
variable

Find the first semi-colon in the string stored in the variable #v.

#v := set 'You must be joking ;-)'
#i := strchr /v /- ';' '#v'
// #i == 19

Navigation menu

Personal tools