startsWith
Checks if the input string starts with the specified substring.
Type: transform
Parameters
- input (unknown): The input string to check.
- search (string): The substring to search for at the beginning.
Returns
Type: boolean
True if the input starts with the search string, false otherwise.
Examples
javascript
startsWith("hello world", "hello") // truejavascript
"foo-bar"|startsWith("foo") // truejavascript
startsWith("test", "xyz") // false