* Checks if `string` starts with the given target string. * * @static * @memberOf _ * @category String * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search fro
(string, target, position)
| 11978 | * // => true |
| 11979 | */ |
| 11980 | function startsWith(string, target, position) { |
| 11981 | string = baseToString(string); |
| 11982 | position = position == null |
| 11983 | ? 0 |
| 11984 | : nativeMin(position < 0 ? 0 : (+position || 0), string.length); |
| 11985 | |
| 11986 | return string.lastIndexOf(target, position) == position; |
| 11987 | } |
| 11988 | |
| 11989 | /** |
| 11990 | * Creates a compiled template function that can interpolate data properties |
no test coverage detected