* Removes leading whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [g
(string, chars, guard)
| 22648 | * // => 'abc-_-' |
| 22649 | */ |
| 22650 | function trimStart(string, chars, guard) { |
| 22651 | string = toString(string); |
| 22652 | if (string && (guard || chars === undefined)) { |
| 22653 | return string.replace(reTrimStart, ''); |
| 22654 | } |
| 22655 | if (!string || !(chars = baseToString(chars))) { |
| 22656 | return string; |
| 22657 | } |
| 22658 | var strSymbols = stringToArray(string), |
| 22659 | start = charsStartIndex(strSymbols, stringToArray(chars)); |
| 22660 | |
| 22661 | return castSlice(strSymbols, start).join(''); |
| 22662 | } |
| 22663 | |
| 22664 | /** |
| 22665 | * Truncates `string` if it's longer than the given maximum string length. |
nothing calls this directly
no test coverage detected