Equinox Online Help - Language Reference - A to Z

Home

Left [Statement]

Applies to
SyntaxLeft(StringItem, SectionExpression) = NewExpression
Action[Statement] Assigns to the left most portion of a string.
ScopeUsable anywhere.
Notes

The left most characters (defined by SectionExpression) are removed from StringItem. NewExpression is then inserted at the start of StringItem, in a cut-and-paste style operation. You cannot insert characters beyond the maximum size of string (remember that trailing spaces in fields and workareas are ignored).

This statement works in a similar way as the [ ] notation, which you can use to assign to a single character in a string.

Note that you can also use left as a function, to return part of a string. This feature is described separately, in the previous section.

CategoryString handling
See Also ChrList, Chrs, Compare, Fill, IsNumber, Left_Function, Len, Match, Maxlen, Mid_Function, Remove, Replace, Right_Function], Search_SearchNext, SetLen, SetMaxLen, SortOrder, SubstituteData
Example

The following example changes the contents of the variable txt from "statement" to "function".

string txt

txt="statement"

Right(txt, 4) = "" | state
Right(txt, 1) = "ion" | station

Left(txt, 3) = "ac" | action
txt[1] = "fi" | fiction

Mid(txt, 2, 1) = "un" | function