15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 16 ✦ String and Number Objects (Chapters 34 and 35)<br />

var form = document.forms[0]<br />

var param1 = parseInt(form.param1.options[form.param1.selectedIndex].value)<br />

var param2 = parseInt(form.param2.options[form.param2.selectedIndex].value)<br />

if (!param2) {<br />

form.result1.value = mainString.substring(param1)<br />

} else {<br />

form.result1.value = mainString.substring(param1, param2)<br />

}<br />

}<br />

<br />

<br />

<br />

String substr() Method<br />

<br />

Text used for the methods:<br />

Electroencephalograph<br />

----5----5----5----5-<br />

<br />

<br />

String MethodMethod ParametersResults<br />

<br />

string.substring()<br />

(&nbsp;<br />

0<br />

1<br />

2<br />

3<br />

5<br />

,<br />

<br />

(None)<br />

3<br />

5<br />

10<br />

&nbsp;) <br />

<br />

<br />

<br />

<br />

<br />

<br />

string.toLowerCase()<br />

string.toUpperCase()<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓<br />

483<br />

stringObject.toLowerCase()

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!