concatenateStrings()
The strLib.concatenateStrings()system function returns the combined string obtained by appending the second string to the end of the first one.
Syntax
strLib.concatenateStrings(
string1 STRING | CHAR | DBCHAR | MBCHAR | UNICODE In,
string2 STRING | CHAR | DBCHAR | MBCHAR | UNICODE In
separator STRING? | CHAR? | DBCHAR? | MBCHAR? | UNICODE? In)
returns (result STRING | CHAR | DBCHAR | MBCHAR | UNICODE)
- string1
-
Inputcan be any value that is assignment compatible with any of the above types.
- string2
-
Inputcan be any value that is assignment compatible with any of the above types.
- separator
-
Input can be any value that is assignment compatible with any of the above types. separator is an optional parameter representing a character that will be inserted between the two input strings.
- result
-
Thevalue obtained from the concatenation of string1and string2, that is assignment compatible with any of the above types.
Example
function main()
str1 String = “ABCDE”;
str2 String = “FGHIL”;
char1 Char(5) = “ABCDE”;
char2 Char(5) = “FGHIL”;
uni1 Unicode(5) = “ABCDE”;
uni2 Unicode(5) = “FGHIL”
separatorUni Unicode(1) = “-”
sysLib.writeStdout(strLib.concatenateStrings(str1, str2) + “, is the concatenated string”);
sysLib.writeStdout(strLib.concatenateStrings(char1, char2) + “, is the concatenated char”);
sysLib.writeStdout(strLib.concatenateStrings(uni1, uni2, separatorUni) + “, is the concatenated Unicode”);
end
The output is as follows:
ABCDEFGHIL, is the concatenated string for String
ABCDEFGHIL, is the concatenated char for Char
ABCDE-FGHIL, is the concatenated unicode for Unicode