MDrivenWiki
Log in

OCLOperators subString

From MDrivenWiki

substring ( lower : Integer, upper : Integer ) : String

Returns a string containing all characters from self starting from index *lower* up to index *upper* included. Both *lower* and *upper* parameters should be contained between *1* and *self.size()* included. *lower* cannot be greater than *upper*.

Expression Result
'substring operation'.substring(11, 19) 'operation'
'substring operation'.substring(1, 1) 's'
'substring operation'.substring(0, 1) invalid