Left

From NSB App Studio
Revision as of 15:29, 25 March 2019 by Ghenne (talk | contribs) (→‎Related Items)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

Left(string, length)

Description

Left returns a string containing a specified number of characters from the left end of a string. The required parameter, string, is any valid string expression. The required parameter, length, is any valid numeric expression. If length is 0, an empty string ("") is returned. If length is greater than the size of string, the entire string is returned.

Example (Basic)

Rem Left Example
'Left returns substring from string left end
Dim Wendy, Eric
Wendy = "Testaburger"
Eric = "Cartman"
Print "The Left 4 of " & Wendy & ": " _
  & Left(Wendy, 4)
Print "The Left 4 of " & Eric & ": " _
  & Left(Eric, 4)

Output

The Left 4 of Testaburger: Test
The Left 4 of Cartman: Cart

Related Items

Len, Mid, Right