TRIML
The TRIML function removes leading spaces from a string.
Syntax 1
function triml (arg-1)
Syntax 2
$triml (arg-1)
Arguments
arg-1 must be a alphanumeric data item or literal.
Result
The function returns the value of arg-1 stripped of leading spaces.
Examples
Example - Display a combined message after trimming the spaces from the variable part.
working-storage section.
77 w-name pic x(32) value " John".
...
procedure division.
...
display "Hello " function triml(w-name) ", how are you?".