🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators strToInt


Returns an Integer with a value equal to self, or |invalid| if self does not represent an integer.

Expression Result
'3.0'.strtoint invalid
'4'.strtoint 4
'toInteger'.strtoint invalid

See also: Parse


Format Example Valid Result
Positive Integer '40' Yes 40
Negative Integer '-20' Yes -20
Zero '0' Yes 0
With Whitespace ' 100' Yes 100
Decimal '13.4' No 0
Comma-Separated '5,500' No 0
Non-Numeric 'abc' No 0
Empty String '' No 0