Returns a string value that is the concatenated result of two or more arguments passed to the function. As of Helium 1.3.1 null values will be treated as empty strings.
@Test
void testConcatenate(){
Assert:isEqual("abcdef",String:concat("abc","def"),"Concatenate returned an incorrect string");
Assert:isEqual("abcdef", String:concat("abc",null,"def"), "Concatenate returned an incorrect string");
}
String:split
Returns an array of string values that represent the tokens from the value expression that are separated by the separator expression.
Note that in order to split a special character such as '|', one needs to escape the string with a '\' character. The '\' may need to be escaped as well, so in this case one will end up with String:split(someText, "\\|").
@Test
void testSplit(){
string[] result =String:split("abc def"," ");
Assert:isEqual(2, result.length(),"Split returned an incorrect number of tokens");
Assert:isEqual(result.get(0),"abc","Split returned an incorrect first token");
Assert:isEqual(result.get(1),"def","Split returned an incorrect second token");
Add Comment