1 | var toString = require('../lang/toString');
|
2 | /**
|
3 | * Checks if string starts with specified prefix.
|
4 | */
|
5 | function startsWith(str, prefix) {
|
6 | str = toString(str);
|
7 | prefix = toString(prefix);
|
8 |
|
9 | return str.indexOf(prefix) === 0;
|
10 | }
|
11 |
|
12 | module.exports = startsWith;
|
13 |
|