Tinderbox v10 Icon

String.skipLine()


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.5.0

 Baseline

 As at baseline


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


String.skipLine()

String.skipLine

The dot-operator String.skipLine skips forward to the next carriage return or to the end of the String stream. String.skipLine fails if the string is exhausted, i.e. the stream cursor remains where it was before the call.

The sort of scenario with which this helps is where the desired line(s) has no identifiable label but is preceded by a separate area of the stream that can be found. Thus in a raw email transcript the content includes labels like 'To:' and 'Subject:' but has nothing for the main body copy, which simply forms all content after the Subject line.

Most stream operators work up to the end of the current line but exclude the line break characters (\n) that separates each line. In the above scenario, where the needed line cannot be detected but the preceding line can be, .skipLine allows code like this:

$Source.captureTo("Subject:").skipLine.captureRest("Text") 


See also—notes linking to here: