Monday 30 November 2015

Javascript: Operating on a string

What can we do upon a string?
1. Looking its length
2. Searching index of a string from it
3. Extracting a string from it
4. Inserting a string into it.

Looking for how long / length

a.length


Searching for index
indexOf()
lastIndexOf()

Powerful search using RegEx.

Extracting parts
slice(firstindex, lastindex)

No comments:

Post a Comment