String

String

The standard type String represents strings, which can be both ASCII or Unicode. String is itself an instance of the metatype PrimitiveType (from UML).

conformsTo OclComparable , OclSummable

Operations

=(object2 : OclSelf[?]) : Boolean[1] precedence: EQUALITY

<>(object2 : OclSelf[?]) : Boolean[1] precedence: EQUALITY

<(s : OclSelf[?]) : Boolean[1] precedence: RELATIONAL

True if self is less than s, using the locale defined by looking up oclLocale in the current environment.

<=(s : OclSelf[?]) : Boolean[1] precedence: RELATIONAL

True if self is less than or equal to s, using the locale defined by looking up oclLocale in the current environment.

>=(s : OclSelf[?]) : Boolean[1] precedence: RELATIONAL

True if self is greater than or equal to s, using the locale defined by looking up oclLocale in the current environment.

>(s : OclSelf[?]) : Boolean[1] precedence: RELATIONAL

True if self is greater than s, using the locale defined by looking up oclLocale in the current environment.

+(s : String[?]) : String[1] precedence: ADDITIVE

The concatenation of self and s.

at(i : Integer[?]) : String[1] invalidating

Queries the character at position i in self.

characters() : Sequence(String)

Obtains the characters of self as a sequence.

compareTo(that : OclSelf[?]) : Integer[1]

The comparison of self with that. -ve if less than, 0 if equal, +ve if greater than.

concat(s : String[?]) : String[1]

The concatenation of self and s.

endsWith(s : String[?]) : Boolean[1]

Returns true if self ends with the string s. Every string ends with the empty string.

equalsIgnoreCase(s : String[?]) : Boolean[1]

Queries whether s and self are equivalent under case-insensitive collation.

indexOf(s : String[?]) : Integer[1]

Queries the first index in self at which s is a substring of self, or zero if s is not a substring of self. The empty string is a substring of every string at index 1 (and also at all other indexes).

lastIndexOf(s : String[?]) : Integer[1]

Queries the last in self at which s is a substring of self, or zero if s is not a substring of self. The empty string is a substring of every string at index self-size()+1 (and also at all other indexes).

matches(regex : String[?]) : Boolean[1]

Use a regular expression match and return true if self matches regex, false otherwise.

replaceAll(regex : String[?], replacement : String[?]) : String[1] invalidating

Return a string derived from self by replacing all matches of regex by replacement.

replaceFirst(regex : String[?], replacement : String[?]) : String[1] invalidating

Return a string derived from self by replacing the first match of regex by replacement.

size() : Integer[1]

The number of characters in self.

startsWith(s : String[?]) : Boolean[1]

Returns true if self starts with the string s. Every string starts with the empty string.

substituteAll(oldSubstring : String[?], newSubstring : String[?]) : String[1]

Return a string derived from self by replacing all occurrences of oldSubstring by newSubstring.

substituteFirst(oldSubstring : String[?], newSubstring : String[?]) : String[1]

Return a string derived from self by replacing the first occurrence of oldSubstring by newSubstring. Returns invalid if there is no first occurrence.

substring(lower : Integer[?], upper : Integer[?]) : String[1] invalidating

The sub-string of self starting at character number lower, up to and including character number upper. Character numbers run from 1 to self.size().

toBoolean() : Boolean[1] invalidating

Converts self to a boolean value.

toInteger() : Integer[1] invalidating

Converts self to an Integer value.

toLower() : String[1]

This is a deprecated variant of toLowerCase() preserving compatibility with traditional Eclipse OCL behaviour.

toLowerCase() : String[1]

Converts self to lower case, using the locale defined by looking up oclLocale in the current environment. Otherwise, returns the same string as self.

toReal() : Real[1] invalidating

Converts self to a Real value.

toString() : String[1]

Returns self.

toUpper() : String[1]

This is a deprecated variant of toUpperCase() preserving compatibility with traditional Eclipse OCL behaviour.

toUpperCase() : String[1]

Converts self to upper case, using the locale defined by looking up oclLocale in the current environment. Otherwise, returns the same string as self.

tokenize() : Sequence(String)

Partition self into a sequence substrings separated by any of space, line-feed, carriage-return, form-feed and horizontal-tab delimiters. The delimiters are omitted from the return.

tokenize(delimiters : String[?]) : Sequence(String)

Partition self into a sequence substrings separated by characters in the delimiters. The delimiters are omitted from the return.

tokenize(delimiters : String[?], returnDelimiters : Boolean[?]) : Sequence(String)

Partition self into a sequence substrings separated by characters in the delimiters. If returnDelimeters is true the returned sequence includes the delimiters, otherwise the delimiters are omitted.

trim() : String[1]

Return self with leading and trailing whitespace removed.