2.1.2 • Published 5 years ago

string-starts-with-x v2.1.2

Weekly downloads
49
License
MIT
Repository
github
Last release
5 years ago

string-starts-with-x

Determines whether a string begins with the characters of a specified string.

module.exportsboolean

This method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.

Kind: Exported member
Returns: boolean - true if the given characters are found at the beginning of the string; otherwise, false.
Throws:

  • TypeError If string is null or undefined.
  • TypeError If searchString is a RegExp.
ParamTypeDescription
stringstringThe string to be search.
searchStringstringThe characters to be searched for at the start of this string.
positionnumberThe position in this string at which to begin searching for searchString; defaults to 0.

Example

import startsWith from 'string-starts-with-x';

const str = 'To be, or not to be, that is the question.';

startsWith(str, 'To be'); // true
startsWith(str, 'not to be'); // false
startsWith(str, 'not to be', 10); // true
2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.13

5 years ago

2.0.12

5 years ago

2.0.11

5 years ago

2.0.10

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

7 years ago

1.0.0

7 years ago