Description

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?

  • The script can be used to split a long string retreived from a server containing several different things.
  • In a level editor, when the user wants to saves the level, this is saved in a long string. With string_split(substr, str, ignoreEmptyStrings) you can split this long string into smaller bits which you can use thereafter.
  • Many more things which we would like to hear from you!

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).

Version 1.0.1. Published August 9, 2018

Created with GameMaker: Studio v1.4.1804

Age Rating: 4+

Privacy Policy

Average Rating

Your review

You can only review assets you've bought.


Gravatar

Bao P 12 May 2018

Good job

simple but very useful

This review was left for a previous version of this asset.


Gravatar

Lucas D 21 April 2018

Nice work

That's what i need. Thanks man!

This review was left for a previous version of this asset.


Gravatar

Ishina N 14 February 2018

Brilliant, saved my life

Searched for hours for a good string split system that wasn't too complicated and this was the only good one I could find would give 10 stars if I could, keep up the good work!

Side note: you also taught me how to put little comments to tell me which argument means what in custom scripts, thank you!! (3 backslashes at the start e.g ///turn_off(time, place))

This review was left for a previous version of this asset.


Gravatar

Anzhel D 07 January 2018

Ehm its working, i guess

This review was left for a previous version of this asset.

Package contents

Loading, please wait

What is the issue?

Back to Top