StringConcatenate

この関数は渡されたパラメータの文字列を形成しそのサイズを返します。パラメータは任意の型です。パラメータの数は 2 以上で 64を超えることは出来ません。

int  StringConcatenate(
  string&  string_var// 形成する文字列
  void argument1       // 任意の基本データ型を持つ1 番目のパラメータ
  void argument2        // 任意の基本データ型を持つ2 番目のパラメータe
  ...                    // 任意の基本データ型を持つ次のパラメータ
  );

パラメータ

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(text, text1, text2, text3, num3, text31, textN, text4, "\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 line, at the end of which there is a line break control code.
  This is line number 3, the number of which is entered into the function as a separate parameter.
  This is line number 4, preceded by a separate parameter with a line break code.
  Line 5 includes a real number: 0.12345
  Length of the resulting string = 358
 */
 }

参照

StringAddStringSplitStringSubstr