StringConcatenate

함수는 전달된 매개 변수의 문자열을 형성하고 형성된 문자열의 크기를 반환합니다. 매개 변수는 어떤 유형도 될 수 있습니다. 매개 변수의 수는 2보다 작거나 또는 64보다 클 수 없습니다.

int  StringConcatenate(
   string&  string_var,   // 결합할 문자열
   void argument1         // 모든 단일 유형의 첫 번째 매개 변수
   void argument2         // 모든 단일 유형의 두 번째 매개 변수
   ...                    // 모든 단일 유형의 다음 매개 변수
   );

매개 변수

string_var

[out]  연결의 결과로 형성되는 문자열.

argumentN

[in]  쉼표로 구분된 값. 모든 단순 유형의 2 - 63개 매개 변수.

반환값

문자열 유형으로 변환된 매개 변수의 연결로 형성된 문자열 길이를 반환합니다. 매개변수는 Print()Comment()에서와 동일한 규칙에 따라 문자열로 변환됩니다.

예:

void OnStart()
  {
//--- 결합에 참여하는 변수를 선언하고 정의합니다.
   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);
   
  /*
  결과
   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
  */
  }

참고 항목

StringAdd, StringSplit, StringSubstr