starts-with
The starts-with checks whether the first string starts with the second string and returns true or false.
The `starts-with` checks whether the first string starts with the second string and returns true or false.
## Syntax
```plain
starts-with(haystack, needle)
```
### Parameters
- `haystack`
- : The string to look in.
- `needle`
- : The string to look for.
### Return value
`true` if `haystack` starts with `needle`. Otherwise, `false`.
## Specifications
[XPath 1.0 4.2](https://www.w3.org/TR/xpath-10/#function-starts-with)
## Gecko support
Supported.
source: MDN Web Docs mirror · page
Cite this
"starts-with". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/XML/XPath/Reference/Functions/starts-with JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy