mql5 split string

Solutions on MaxInterview for mql5 split string by the best coders in the world

showing results for - "mql5 split string"
Antonella
25 Jan 2018
1string to_split="_life_is_good_"; // A string to split into substrings
2   string sep="_";                // A separator as a character
3   ushort u_sep;                  // The code of the separator character
4   string result[];               // An array to get strings
5   //--- Get the separator code
6   u_sep=StringGetCharacter(sep,0);
7   //--- Split the string to substrings
8   int k=StringSplit(to_split,u_sep,result);
9   //--- Show a comment 
10   PrintFormat("Strings obtained: %d. Used separator '%s' with the code %d",k,sep,u_sep);