String Object Examples

NOTE: The output above was produced by the following code below:

<SCRIPT LANGUAGE="JavaScript">

var myStr = "Look At This";

document.write('<BLOCKQUOTE>');
document.write('var myStr = "Look At This";<P>');
document.write('<B><FONT COLOR="blue">Property</FONT></B><BR>');
document.write("myStr.length == " + myStr.length + '<P>');
document.write('<B><FONT COLOR=BLUE>Methods</FONT></B><BR>');
document.write("myStr.toUpperCase() == " + myStr.toUpperCase() + '<BR>');
document.write("myStr.toLowerCase() == " + myStr.toLowerCase() + '<P>');
document.write("myStr.charAt(5) == " + myStr.charAt(5) + '<BR>');
document.write("myStr.substring(5, 7) == " + myStr.substring(5, 7) + '<P>');
document.write('myStr.indexOf("o") == ' + myStr.indexOf("o") + '<BR>');
document.write('myStr.lastIndexOf("o") == ' + myStr.lastIndexOf("o") + '<BR>');
document.write('</BLOCKQUOTE>');

</SCRIPT >