Java Reference
In-Depth Information
Converts the first character in a String to its uppercase equivalent, as shown
here:
log
('test'.firstToUpper());
result: Test
lastToUpper
String
::lastToUpper () :
String
Converts the last character in the String to its lowercase equivalent, as shown
here:
log
('test'.lastToUpper());
result: test
indexOf
String
::indexOf (match :
String
) :
Integer
Returns the index of the first character found in the match String on the tar-
get String. If the match is not found,
-1
is returned. Following is an example with
corresponding
log
output.
var
s :
String
:= 'Find me in the string';
log
(s.indexOf('me').toString());
result: 5
Note that M2M QVT OML provides another variant of this operation not
listed in the specification:
String::indexOf(match : String, startIndex : Integer) : Integer
Following is an example of this version of
indexOf()
, which provides the
index of the first character in the match String after the
startIndex
argument
position. In this case, the second
me
String begins at index 17:
var
s :
String
:= 'Find me and then me in the string';
log
(s.indexOf('me', 6).toString());
result: 17
Search WWH ::
Custom Search