引数名 | 初期値 | I/O | 詳細 |
string_value | - | In | 分離する文字列
(この文字列自身は分離されません) |
separator | - | In | 区切り用の文字コード。
指定した文字コードで文字列を分離します。 文字列から文字コードを取得するにはStringGetCharacter()関数を使用します。 |
result[] | - | Out | 分離された文字列を格納する文字列配列 |
#property strict // strictは絶対に削除しない事 void OnInit() { string tempstr = "123_456_789"; string sep_str[]; int sep_num; sep_num = StringSplit(tempstr , '_' , sep_str); Print("ソース文字列:",tempstr); for ( int icount = 0; icount < sep_num ; icount++ ) { printf("sep_str[%d]:%s",icount,sep_str[icount]); } }
ソース文字列:123_456_789 sep_str[0]:123 sep_str[1]:456 sep_str[2]:789