tutorial 4: string handling

watch it on YouTube

Notes

Resources

JavaScript Commands

toString()
method that converts a number to a string
.length
property that returns the length of a string. Use example:
var x = "some string";
var y = x.length;
indexOf()
method that returns the numerical index value of the first character of a specific string that is sent as a parameter. Use example:
y = x.indexOf("string");
substr(start, length)
method that extracts part of a string from a start value and of a specified length.
slice(start, end)
method that extracts part of a string from the start value to the end value.
replace (original, replacewith)
method that replaces the first instance of a string with another string.