StringTrimLeft

この関数は、文字列の最初の意味のあるシンボルの左部分にある改行文字、スペースやタブを切り取ります。文字列は直接(コピーなどされずに)変更されます。

int  StringTrimLeft(
  string&  string_var      // 切られる文字列
  );

パラメータ

string_var

[in][out]  左から切られる文字列

戻り値

切り取られたシンボルの数

例:

void OnStart()
 {
//--- 左側に6つのスペースを含むソース文字列を定義する
  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'", num, text);
 
 /*
  結果
  Source line:
  '     All spaces on the left will be removed from this string'
  The StringTrimLeft() function removed 6 chars from the left side. Now the line looks like this:
  'All spaces on the left will be removed from this string'
 */
 }

参照

StringTrimRightStringToLowerStringToUpper