@newdash/newdash
Version:
javascript/typescript utility library
27 lines (26 loc) • 635 B
TypeScript
/**
* Checks if `string` starts with the given target string.
*
* @since 5.2.0
* @category String
* @param string The string to inspect.
* @param target The string to search for.
* @param position The position to search from.
* @returns Returns `true` if `string` starts with `target`,
* else `false`.
* @see [[endsWith]], [[includes]]
* @example
*
* ```js
* startsWith('abc', 'a')
* // => true
*
* startsWith('abc', 'b')
* // => false
*
* startsWith('abc', 'b', 1)
* // => true
* ```
*/
export declare function startsWith(string: string, target: string, position?: number): boolean;
export default startsWith;