Tinderbox v10 Icon

String.skipWhitespace()


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Data Type Returned: 

Operator First Added: 

Operator in Current Baseline: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Stream parsing  [other Stream parsing operators]

 String [about String data type]

 v9.1.0

 Baseline

 As at baseline


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


String.skipWhitespace()

String.skipWhitespace

Advances the String stream to the first character that is not whitespace. A failure occurs if the stream is exhausted.

For example:

vText = $Text.skipWhitespace(); 

Tests that the next characters in the stream are non-word, and advances the stream beyond the detected whitespaces characters. Otherwise, it fails and the cursor does not advance. Either way, the variable vText receives the resulting text stream as would any operator chained to .skipWhitespace() unless a failure occurs in which case chained operators are not processed.

If the stream passed in is " Hello world" (note the leading spaces) then the spaces are detected and the cursor returns "Hello world". But if the stream passed in is "Hello world" a word is detected and the cursor does not advance.

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.


See also—notes linking to here: