Download MetaTrader 5

Question, how to divide one long string to several short string values (mql5)

To add comments, please log in or register
Gang Wu
173
Gang Wu  

about mql5 string function

For example,

before: string testr = "macd,9,13,26";

after:

testr1="macd";

testr2=9;

testr3=13;

testr4=26;

Here need to work with a long string with several ","(or others like "-")characters within it and then divide into different short strings, the number of short string/number can be more than 10.

I found mql5 string functions chm files and website but get no answer, anyone have good solutions? 

Alain Verleyen
Moderator
31608
Alain Verleyen  
string testX[];
if(StringSplit(testr,',',testX)!=-1)
...
Gang Wu
173
Gang Wu  
Alain Verleyen:


Great, got it, thanks for your kindly comment, Alain. 

To add comments, please log in or register