Slicing a String : String : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » String »

 

Slicing a String



<HTML>
<HEAD>
<TITLE>String Slicing and Dicing, Part I</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var mainString = "This is a test"
function showResults() {
    var form = document.forms[0]
    var param1 = 2;
    var param2 = 3;
    if (!param2) {
        alertmainString.slice(param1));
    else {
        alertmainString.slice(param1, param2));
    }
}
</SCRIPT>
</HEAD>
<BODY onLoad="showResults()">
</BODY>
</HTML>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» String