Introduction
Appsurd presents you the superuseful and handy script: string_split(substr, str, ignoreEmptyStrings) ! It works on GMS 1.4 and GMS 2. The script returns an array which contains the splitted string. You may also choose a substring which is longer than one character! Of course the script is well-commented and you may use it for free. If you want to give us credits (not obligatory but you may do so) please put down Appsurd!
When is it useful?
Example
Create Event
var str = "Hello world!";
splitted_string = string_split(" ",str,false);
Draw Event
for(i=0; i<array_length_1d(splitted_string); i+=1)
{
draw_text(10,10+20*i,splitted_string[i]);
}
Result
Hello
world!
Conclusion
If you have any improvements or if you found a bug, please tell us so we can improve it! Rating and sharing will be appreciated! :)
End User Licence Agreement (EULA).