diff --git a/src/replacements/string/_String_startsWith.js b/src/replacements/string/_String_startsWith.js new file mode 100644 index 00000000..db6ef0f1 --- /dev/null +++ b/src/replacements/string/_String_startsWith.js @@ -0,0 +1,12 @@ +var _String_startsWith = F2( + function (prefix, str) { + var prefixLength = prefix.length; + var i = -1; + if (str.length < prefixLength) { + return false; + } + while (++i < prefixLength) { + if (prefix[i] !== str[i]) { return false; } + } + return true; + }); \ No newline at end of file