Operator Type:
Operator Scope of Action:
Operator Purpose:
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]
v9.1.0
Baseline
As at baseline
Syntax note: Operators without any defined mandatory arguments may omit their empty closing parentheses
String.failed()
String.failed
.failed tests for a failed Stream processing action String.try{}, including an explicit fail() call. It returns true
if the current operation has failed, and false otherwise.
When processing a string, it may be that the string is not what was expected. Thus the .failed operator raises a flag to say this process did not work.
A .failed flag is reset to false
when the current try{} expires, or when the current action is complete.
For example, to test if a 'try' sequence has failed:
if ( $MyString.try{ … }.failed() ) {
$Color="bright red";
}