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
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:countis less than zero, strLeft() returns an empty string.countis less thanvalue.length, strLeft() returns a new string with thecountnumber of characters from the left of the string.countis greater thanvalue.length, then the value original value is returned.Any argument value that is NaN is treated as if it were 0.