Language Reference

CONCAT Function

performs elementwise string concatenation

CONCAT( argument1, argument2\lt, ... , argument15>)

where arguments are character matrices or quoted literals.

The CONCAT function produces a character matrix containing elements that are the concatenations of corresponding element strings from each argument. The CONCAT function accepts up to 15 arguments, where each argument is a character matrix or a scalar. All nonscalar arguments must conform. Any scalar arguments are used repeatedly to concatenate to all elements of the other arguments. The element length of the result equals the sum of the element lengths of the arguments. Trailing blanks of one matrix argument appear before elements of the next matrix argument in the result matrix. For example, suppose you specify the following matrices:

  
    b={"AB" "C ", 
       "DE" "FG"}; 
    c={"H " "IJ", 
       " K" "LM"};
 
The following statement produces the new 2 x 2 matrix a, as shown:
  
    a=concat(b,c);
 

  
           A         2 rows      2 cols    (character, size 4) 
  
                              ABH  C IJ 
                              DE K FGLM
 
Quotation marks (") are needed only if you want to embed blanks or maintain uppercase and lowercase distinctions. You can also use the ADD infix operator to concatenate character operands.

Previous Page | Next Page | Top of Page