SHARE
TWEET

convert_string_to_list

a guest Sep 29th, 2015 163 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// convert_string_to_list(string,char)
  2. /*
  3. Parses through a string and creates a list out of each
  4. section of characters before and after the 'char'.
  5. Example: 1,5,10 will return a list of each number if char == ","
  6. */
  7. var str_temp = string(argument0);
  8. var list = ds_list_create();
  9. var str1 = "";var str2 = "";var i = 1;
  10. for(i=1;i<=string_length(str_temp);i++){
  11. str1 = string_char_at(str_temp,i);
  12. str2 = str2 + str1;
  13. if ( str1 == argument1 or i == string_length(str_temp) ){ds_list_add(list,str2);str2="";}
  14. }
  15. return list;
  16.  
  17. ds_list_destroy(list);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top