R4R
Right Place For Right Person TM
R4R ASP.NET with C# JavaScript Tutorials slice() Method
previous

Home

Next

slice() Method

The slice() method extracts a part of a string and returns the extracted part in a new string.

Syntax:

string.slice(begin,end)

Example:

<html>
<body>
<script>
function slice_string()
{
var myName = new String('Aditya Tiwari'); 
   alert(myName+'\n'+"After Slice="+ myName.slice(1,6));
}
</script>
<button onclick="slice_string()">Slice of Name</button>
</body>
</html>

Output:

 

 

previous

Home

Next


Tolal:0 Click:
Show All Comments

Post Your Comments

Your Name:

Your Email ID :
Comments :
URL
  =* Enter SUM

New Updates

R4R
R4R
R4R
R4R
R4R
R4R
R4R
R4R