This version is out of date, covering development from v9.5.0 to v9.7.3. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

String.skipToNumber()


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Stream parsing  [other Stream parsing operators]

 Baseline

 As at baseline


Syntax note: Operators without any defined mandatory arguments may omit their empty closing parentheses


String.skipToNumber()

String.skipToNumber

Advances the String stream to the next number (i.e. one of more continuous number characters). A failure occurs if the stream is exhausted.

For example:

vText = $Text.skipToNumber(); 

Tests that the next characters in the stream read from $Text is a sequence of digits, and advances the stream past a continuous runs of digits. Otherwise, it fails and the cursor does not advance. Either way, variable vText receives the resulting text stream (as would any operator chained to .skipToNumber() unless a failure occurs in which case chained operators are not processed.

If the input stream passes in "1234 items" the cursor advances past '1234' such that the remaining stream is " items".

If the input stream passes in "1,234 items" the cursor advances past '1' such that the remaining stream is "234 items". Notice how number formatting delimiters like a comma (or other locale-specific delimiters) used in string representations of numbers may confuse this operator is used without care.

The presumption for use of this operator is as an assist to help ensure to-be-captured content is correctly detected. Essentially, this is a 'if' style test: if the test is correct proceed, else the cursor remains where it is for any possible chained stream parsing operators.