String
String operations available in OCL expressions.
ConcatExpression
Returns a string that is the concatenation of self and s.
Signature
txt
String::concat (s : String) : StringExample
txt
self.name.concat("string")IndexOfExpression
Returns the index of s in self, or 0 if not found.
Signature
txt
String::indexOf (s : String) : NumberExample
txt
self.name.indexOf("string")SubstringExpression
Returns a substring from index start up to and including index end. Both parameters must be between 1 and self.size(). start cannot be greater than end.
Signature
txt
String::substring (start : Number, end : Number) : StringExample
txt
self.name.substring(0,2)ToIntegerExpression
Tries to convert the string to an integer.
Signature
txt
String::toInteger () : NumberExample
txt
"3".toInteger()ToLowerCaseExpression
Returns self as a lower case string.
Signature
txt
String::toLowerCase () : StringExample
txt
self.name.toLowerCase()ToRealExpression
Tries to convert the string to a real number.
Signature
txt
String::toReal () : NumberExample
txt
"3.414".toReal()ToUpperCaseExpression
Returns self as an upper case string.
Signature
txt
String::toUpperCase () : StringExample
txt
self.name.toUpperCase()