Java Reference
In-Depth Information
format
String
::format (value:
Object
) :
String
Similar to the Java
format()
method and the C
printf()
function, this
operation prints a message substituting parameters
%s (String)
,
%d
(Integer)
, and
%f (Float)
with a value. If multiple parameters are declared,
a Tuple is passed as the value, with its elements used for substitution.
Additionally, a Dictionary can be used for the value, in which case the format of
the parameter is
%(key)s
, where
key
is looked up in the Dictionary.
This operation is not currently implemented.
size
String
::size () :
Integer
Returns the number of characters in the String. A synonym operation
length()
is called out in the specification but is not implemented in M2M QVT
OML. Following is an example of
size()
and its output from within a log
expression where
toString()
is used to convert the Integer:
log
('This string has 29 characters'.size().toString());
result: 29
substringBefore
String
::substringBefore (match :
String
) :
String
Returns the substring that appears in the character sequence before the
sequence to match passed as a parameter. If no match is found, the entire String
is returned.
log
('test'.substringBefore('s'));
result: te
substringAfter
String
::substringAfter (match :
String
) :
String
Search WWH ::
Custom Search