opTrim

Type: TParseOption | Unit: EgStrParser

Removes leading and trailing spaces from the input and from each token, before any other processing.

For the non-string types (itInteger to itDateTime) spaces are already removed from the whole input before tokenization, so opTrim has no further effect there; it is accepted silently.

For itString spaces are part of the value by default, and opTrim is the only way to remove them:

Input: "  hello  ", itString, []
  Values[0]: "  hello  "    (spaces kept)

Input: "  hello  ", itString, [opTrim]
  Values[0]: "hello"        (spaces removed)

Whitespace-only input counts as empty for every type except itString without opTrim, where the spaces are a value: ' ' gives otSingleValue and = ' '.

With opRequired, opTrim is applied first: input made of spaces only becomes empty and gives ERR_EMPTY_NOT_ALLOWED.

See Also

(C) 2026 Easygate, Lda