StringConcatenate

A função forma uma string de parâmetros passados e retorna o tamanho da string formada. Parâmetros podem ser de qualquer tipo. O número de parâmetros não pode ser menor que 2 ou maior que 64.

int  StringConcatenate(
   string&  string_var,   // string para formar
   void argument1         // primeiro parâmetro de qualquer tipo simples
   void argument2         // segundo parâmetro de qualquer tipo simples
   ...                    // próximo parâmetro de qualquer tipo simples
   );

Parâmetros

string_var

[out]  String que será formada como resultado da concatenação.

argumentN

[in]  Quaisquer valores separados por vírgula. De 2 a 63 parâmetros de qualquer tipo simples.

Valor do Retorno

Retorna o comprimento da string, formada pela concatenação dos parâmetros transformados em tipo string. Os parâmetros são transformados em strings em concordância com as mesmas regras aplicadas em Print() e Comment().

Exemplo:

void OnStart()
  {
//--- declaramos e definimos as variáveis envolvidas na concatenação
   string text="";
   string text1="This script shows how the StringConcatenate() function works.\n";
   string text2="This is the second line, at the end of which there is a line break control code.\n";
   string text3="This is line number ";
   int    num3=3;
   string text31=", the number of which is entered into the function as a separate parameter.";
   string textN="\n";
   string text4="This is line number 4, preceded by a separate parameter with a line break code.";
   int    length=StringConcatenate(texttext1text2text3num3text31textNtext4"\nLine 5 includes a real number: "0.12345);
   Print(text"\nLength of the resulting string = "length);
   
  /*
  Resultado
   This script shows how the StringConcatenate() function works.
   This is the second lineat the end of which there is a line break control code.
   This is line number 3the number of which is entered into the function as a separate parameter.
   This is line number 4preceded by a separate parameter with a line break code.
   Line 5 includes a real number0.12345
   Length of the resulting string = 358
  */
  }

Também Veja

StringAdd, StringSplit, StringSubstr