left
First N characters of a string.
Syntax
Section titled “Syntax”v = left(text, num_chars)Description
Section titled “Description”Returns the leftmost num_chars characters from text. Default num_chars is 1. Equivalent to MATLAB’s text(1:num_chars).
Examples
Section titled “Examples”left('hello world', 5) % 'hello'left('abc') % 'a'