跳至内容

StringConcatenate

StringConcatenate

此函数通过连接转换为字符串类型的参数来返回字符串。

string  StringConcatenate(
   void argument1,        // first parameter of any simple type
   void argument2,        // second parameter of any simple type
   ...                    // next parameter of any simple type
   );

参数

argumentN

[in] 任何由逗号分隔的值。可以是2到63个任意简单类型的参数。

返回值

返回通过连接转换为字符串类型的参数所组成的字符串。参数的转换遵循与Print()Comment()相同的规则。

注意

参数可以是任何类型。参数的数量不得少于2个,也不得超过64个。

示例:

string text;
  text=StringConcatenate("Account free margin is ", AccountFreeMargin(), " Current time is ", TimeToStr(TimeCurrent()));
  // text="Account free margin is " + AccountFreeMargin() + "  Current time is " + TimeToStr(TimeCurrent())
  Print(text);

另请参阅

StringAdd()

最后更新于