function string_bean()
//Examples of slicing strings
Carry On!
function string_bean()
//Examples of slicing strings
Carry On!
function string_bean(){
//Example of slicing characters from the end of strings
whole_string1= "/images/picture001.jpg";
whole_string2= "/images/pic002.gif";
whole_string3= "/images/pic_of elephant.png";
document.write(whole_string1.length+" = the number of characters in 'whole_string1'<br />");
document.write(whole_string2.length+" = the number of characters in 'whole_string2'<br />");
document.write(whole_string3.length+" = the number of characters in 'whole_string3'<br />");
document.write(whole_string1.slice(whole_string1.length-4)+" = the last 4 characters of 'whole_string1'<br />");
document.write(whole_string2.slice(0,7)+" = the first 7 characters of 'whole_string2'<br />");
document.write(whole_string3.slice(7+1,whole_string3.length-4)+" = the middle characters of 'whole_string3'<br />");
}