"left" (string::left)

Returns a substring that contains the n leftmost characters of the string.

Synopsis

string string.left(int n);

Parameters

Parameter Description
n Number of characters to return.

Description

Returns a substring that contains the n leftmost characters of the string.

The entire string is returned if n is greater than or equal to length(), or less than zero.

Example

main()
{
  string s = "Control";
  DebugN(s.left(4)); // "Cont"
}

Console output:

WCCOAui1:["Cont"]

Assignment

String