Left
Returns a substring that starts at the beginning of the string.
Syntax
Left(string, nchar)
Parameters
Parameter |
Type |
Description |
---|---|---|
string |
string |
String parameter. |
nchar |
number |
Number of characters in the substring |
Return
Returns a substring that starts at the beginning of the string.
Note
In Python, use string slicing: https://pythoncentral.io/cutting-and-slicing-strings-in-python/
Examples
Python
s = 'abcdefg'
sub = s[:3]
# sub now is "abc"
NexScript
sub = Left("abcdefg", 3)
% sub now is "abc"