The following string functions have been provided:
- Concat
- Contains
- EndsWith
- Format
- LowerCase
- StringLength
- SubStringBefore
- SubStringAfter
- Starts With
- Substring
- Translate
- Trim
- UpperCase
Concat
Concat puts n character strings into one string.
Syntax |
Return value |
||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="72302707-cb1b-487c-a34a-d43b89e22f04"><ac:plain-text-body><![CDATA[ |
concat(String 1 ,.. String [n]) |
String |
]]></ac:plain-text-body></ac:structured-macro> |
Example |
|
||
Expression: |
Result: |
||
concat(„A","B") |
„AB" |
||
concat(nodeValues("//item/USPrice")) |
0.039.98148.95 |
||
concat(nodeValue("./name")," at home") |
"xcentric technology & consulting at home" |
Contains
The Contains function examines whether the argument String1 exists in String2.
Syntax |
Return value |
contains(String1, String2) |
Double (0.0/1.0) |
Example |
|
Expression: |
Result: |
contains("XML","X") |
1.0 |
EndsWith
EndsWith examines whether the character string String1 ends with the argument String2.
Syntax |
Return value |
endsWith(String1, String2) |
Double (0.0/1.0) |
Example |
|
Expression: |
Result: |
endsWith('XML','X') |
0.0 |
endsWith('XML','L') |
1.0 |
Format
Format formats a string in accordance with a pattern definition.
Syntax |
Return value |
format(String1, pattern) |
String |
Example |
|
Expression: |
Result: |
format(1.025,"990,00") |
"1.03" |
Additional explanations to the format () function
With the format() instruction you can format a value on the basis of a text pattern. The following symbols within the pattern are allowed:
Symbol |
Meaning |
0 |
Number |
# |
Number, zero is not displayed |
. |
Decimal separator |
- |
Minus sign |
, |
Group separator |
E |
Separates mantissa from the exponent in the scientific representation. Prefix or suffix must be located in quotation marks. |
(See also: http://java.sun.com/j2se/1.4/docs/api/java/text/DecimalFormat.html)
LowerCase
LowerCase converts all capital letters of the argument into lowercase.
Syntax |
Return value |
lowerCase(String1) |
Double (0.0/1.0) |
Example |
|
Expression: |
Result: |
lowerCase(„XCENTRIC") |
„xcentric" |
StringLength
Returns the number of characters of the argument.
Syntax |
Return value |
stringLength(String1) |
Double |
Example |
|
Expression: |
Result: |
stringLength(„JAXFront") |
8 |
SubStringBefore
SubStringBefore cuts the string argument at the place String2 or at the indicated position respectively, and returns the substring before the separation point.
Syntax |
Return value |
subStringBefore(String1, String2) |
String |
subStringBefore(String1, integer) |
|
Example |
|
Expression: |
Result: |
subStringBefore(„12/10","/") |
„JAX" |
subStringBefore("Xcentric",3) |
"Xc" |
SubStringAfter
SubStringAfter cuts the string argument at the place String2 or at the indicated position respectively, and returns the substring after the separation point.
Syntax |
Return value |
subStringAfter(String1, String2) |
String |
subStringAfter (String1, integer) |
|
Example |
|
Expression: |
Result: |
subStringAfter(„JAXFront","F") |
„JAX" |
subStringAfter("Xcentric",3) |
"ntric" |
StartsWith
Examines whether the String1 begins with the argument String2.
Syntax |
Return value |
startsWith(String1, String2) |
Double (0.0/1.0) |
Example |
|
Expression: |
Result: |
startsWith('XML','X') |
1.0 |
Substring
Substring cuts the argument String1 beginning at the position 0 or at the position start on respectively, up to the end.
Syntax |
Return value |
substring (String1, int end) |
String |
substring (String1, int start, int end) |
|
Example |
|
Expression: |
Result: |
substring('Beatles',1,4) |
'Beat' |
substring('Christian',4) |
'Chri' |
Translate
Translate replaces all elements within String1, which have the value String2 with the value String3 and returns this one as string.
Syntax |
Return value |
translate(String1, String2,String3) |
String |
Example |
|
Expression: |
Result: |
Translate("R2D2","2","3") |
„R3D3" |
Trim
Trim deletes all leading and trailing blanks.
Syntax |
Return value |
trim(String1) |
String |
Example |
|
Expression: |
Result: |
trim(" xcentric ") |
"xcentric" |
UpperCase
UpperCase converts all small letters of the argument String1 into capital letters.
Syntax |
Return value |
upperCase(String1) |
String |
Example |
|
Expression: |
Result: |
upperCase("xcentric") |
„XCENTRIC" |