StringTrimLeft

函数为字符换行,在第一位的实意交易品种后,是字符串左边的字符和标号,字符串适当修改。

int  StringTrimLeft(
   string&  string_var      // 要剪切的字符串
   );

参量

string_var

[in][out]  字符串从左边剪切。

返回值

返回剪切交易品种数量。

示例:

void OnStart()
  {
//--- 定义源字符串(左侧六个空格)
   string text="      All spaces on the left will be removed from this string";
//--- 在日志中显示源字符串
   PrintFormat("Source line:\n'%s'"text);
//--- 删除左侧的所有空格,并在日志中显示删除的字符数和结果字符串
   int num=StringTrimLeft(text);
   PrintFormat("The StringTrimLeft() function removed %d chars from the left side. Now the line looks like this:\n'%s'"numtext);
   
  /*
  结果
   Source line:
   '      All spaces on the left will be removed from this string'
   The StringTrimLeft() function removed 6 chars from the left sideNow the line looks like this:
   'All spaces on the left will be removed from this string'
  */
  }

另见

StringTrimRightStringToLowerStringToUpper