Explorer

std.url-query

description
Extract the query string component after '?' (or "" if none) from a URL string
type
Fn(url: String) -> String
expression
fn(url$1) =>
  let queryIdx$2 = @std.string-index-of(text: $1, target: "?", startIndex: 0);
  match @core.less-than(left: $2, right: 0) {
    true =>
      "",
    false =>
      @core.string-slice(value: $1, start: @core.plus(left: $2, right: 1), end: @core.string-length(value: $1))
  }
visibility
public
std.url-query (project definy, branch commit-check, snapshot Jh11inSnBH1eenK5G-juhyzQabT1OLdy3NmjD6OiVCs)
id: GD7NArBfs8mMYmTy1nyjTQuzi4N0yE-IzL3S9Kyepts
content hash: VX41E9R1YFYnRaxbKIS87fMWxddN9zlQFb9SrQmaOEo