Skip to content

getFragment

getFragment(url) → string · URL

Get the fragment (hash) portion from a URL string.

  • url (required): URL string
bash
echo '{"url": "https://example.com/page#section2"}' | utlx -e 'getFragment($input.url)'
# "section2"
utlx
{
  fragment: getFragment($input.url)
}

Released under AGPL-3.0.