Add starts with operator (#5061)

* add starts_with operator

* added a test
This commit is contained in:
Darren Schroeder
2022-04-01 13:35:46 -05:00
committed by GitHub
parent a088081695
commit 2cb815b7b4
8 changed files with 68 additions and 0 deletions

View File

@ -411,6 +411,10 @@ pub fn eval_expression(
let rhs = eval_expression(engine_state, stack, rhs)?;
lhs.pow(op_span, &rhs)
}
Operator::StartsWith => {
let rhs = eval_expression(engine_state, stack, rhs)?;
lhs.starts_with(op_span, &rhs)
}
}
}
Expr::Subexpression(block_id) => {