May 6, 2013

Using Index of Method in String

Coding

<html>
<body>
<script language="JavaScript">
var str="W3Schools"
var character=str.indexOf("School")
document.write(character + "<br>")
if (character>=0) {
document.write("The string contains the specified character")
}
</script>
</body>
</html>

No comments:

Post a Comment

Popular Posts

Views