/Background Knowledge/
The substring method is used to extract the character of a string intermediary between two specified subscripts
SUBSTRING (start,end)
Start and end position, zero-based index
Parameter description
Start Required. A nonnegative integer that specifies the position of the first character of the substring to be extracted in the stringobject.
Stop is optional. A nonnegative integer that is 1 more than the last character of the substring to extract in Stringobject. If this argument is omitted, the returned substring continues until the end of the string.
return value
A new string value that contains a substring of stringobject whose contents are all characters from start to stop-1, with a length of stop minus start.
Description
The substring returned by the substring method includes the character at start, but does not include the character at end.
If start is equal to end, then the method returns an empty string (that is, a string of length 0).
If start is larger than end, then the method swaps the two parameters before extracting the substring.
If start or end is negative, then it will be replaced with 0
/Practical application: Intercept strings and use ellipses [...] Display
Online Demo: Http://codepen.io/anon/pen/yNXyMX
<! DOCTYPE html>
Javascript: Intercept strings more and use ellipses [...] Show