|
String.left Method
Returns a specified number of characters from the left side of a string.
object.left (length)
Arguments
- object
- Required. Always the name of a String object.
- length
- Numeric expression indicating how many characters to return.
If 0, a zero-length string("") is returned. If greater than or equal to
the number of characters in string, the entire string is returned.
Return Value
The String.left method returns a copy of the string with any leading spaces removed.
Remarks
The following example illustrates the use of the String.left method.
Alert("Hello, world!".left(5));
Requirements
|