Navigation:  ThinBASIC Modules > Core (thinBasic Core Engine) > String functions >

Verify

Previous pageReturn to chapter overviewNext page

 

Description

 

Determine whether each character of a string is present in another string.

 

Syntax

 

n = Verify([Start,] MainString, MatchString)

 

Returns

 

Number

Returns zero if each character in MainString is present in MatchString.

If not, it returns the position of the first non-matching character in MainString.

 

Parameters

 

Name

Type

Optional

Meaning

Start

Number

Yes

Optional starting position inside MainString to start checking from.

If Start evaluates to a position outside of the string on either side, or if Start is zero, VERIFY returns zero

MainString

String

No

String to test

MatchString

String

No

String containing allowed chars

 

Remarks

 

Restrictions

 

Verify is case sensitive

 

See also

 

String Handling,

 

Examples

 

'---Returns 4 since "." is not in "0123456789"

x = VERIFY("123.65,22.5""0123456789")

 

'---Returns 7 since 5 starts it past the first non-digit ("." at position 4)

x = VERIFY(5,"123.65,22.5""0123456789")

 

'---Returns 0 since all chars in MainString are present in MatchString

x = VERIFY("123.65,22.5"".,0123456789")