StringTrimRight
StringTrimRight
函数为字符换行,在最后面的实意交易品种后,是字符串右边的字符和标号,字符串适当修改。
int StringTrimRight(
string& string_var // 要剪切的字符串
);参量
- string_var
[in][out] 字符串从右边剪切。
返回值
返回剪切交易品种数量。
示例:
void OnStart()
{
//--- 定义源字符串(右侧六个空格)
string text="All spaces on the right will be removed from this string ";
//--- 在日志中显示源字符串
PrintFormat("Source line:\n'%s'", text);
//--- 删除右侧的所有空格,并在日志中显示删除的字符数和结果字符串
int num=StringTrimRight(text);
PrintFormat("The StringTrimRight() function removed %d chars from the right side. Now the line looks like this:\n'%s'", num, text);
/*
结果
Source line:
'All spaces on the right will be removed from this string '
The StringTrimRight() function removed 6 chars from the right side. Now the line looks like this:
'All spaces on the right will be removed from this string'
*/
}另见