Returns a substring of the string starting from the left.
strLeft() extracts the number of characters from left of the string up to the count. In particular:
strLeft()
count
value.length', strLeft() returns a new string with the
value.length
Any argument value that is NaN is treated as if it were 0.
The string value to return the substring from.
The number of characters to extract
The substring based on the count number of characters from the right
0.4.2
strLeft("Nevware21", -1); // ""strLeft("Nevware21", 0); // ""strLeft("Nevware21", 1); // "N"strLeft("Nevware21", 3); // "Nev"strLeft("Nevware21", 21); // "Nevware21" Copy
strLeft("Nevware21", -1); // ""strLeft("Nevware21", 0); // ""strLeft("Nevware21", 1); // "N"strLeft("Nevware21", 3); // "Nev"strLeft("Nevware21", 21); // "Nevware21"
Returns a substring of the string starting from the left.
strLeft()
extracts the number of characters from left of the string up to the count. In particular:count
is less than zero, strLeft() returns an empty string.count
is less thanvalue.length', strLeft() returns a new string with the
count` number of characters from the left of the string.count
is greater thanvalue.length
, then the value original value is returned.Any argument value that is NaN is treated as if it were 0.