voidOnStart() { //--- 定义测试字符串 stringtext="123456789012345"; //--- 获取字符串中的交易品种数 intstr_len=StringLen(text); //--- 在日志中显示字符串和其中的交易品种数 PrintFormat("The StringLen() function returned the value of %d chars in string: '%s'", str_len, text); /* 结果 The StringLen() functionreturnedthevalueof15charsin string: '123456789012345' */ }