Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<script>
[green]// Extends the String object.
// Returns the number of occurrences a string appears
// within a string or -1 if not found.
[/green]String.prototype.contains = function(str)
{
var re = new RegExp(str, "gi");
var result = this.match(re);
return result ? result.length : -1;
}
[green]// Usage:[/green]
var myString = "abcabca";
alert(myString.contains("a"));
[green]// Or:[/green]
alert("abcabca".contains("a"));
</script>