String.left()

Signature

String left (String s1, int length)

Domain

action, condition

Description

Returning a String containing the first length characters of the string s1.

Parameters

NameTypeDescription
s1StringA String to test.
lengthintThe length of the String.

Returns

TypeDescription
StringThe result String.

Cautions

none

Example


String result = String.left ("Hello world", 3);

Result is:
result: "Hel"