Explorer

std.string-starts-with

description
Whether value starts with prefix
type
Fn(value: String, prefix: String) -> Boolean
expression
fn(value$0, prefix$1) =>
  let length$2 = @core.string-length(value: $1);
  match @core.less-than(left: @core.string-length(value: $0), right: $2) {
    true =>
      false,
    false =>
      @core.equal(left: @core.string-slice(value: $0, start: 0, end: $2), right: $1)
  }
visibility
public
std.string-starts-with (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: lvizVRnMzghbOQpi-pnE1fvkTvBN0l_yEau-pWBH52c
content hash: 6Jrd2LGHWVa_FNztwOFZg-6Rd_B2uEwP2hg3WnCosHM