Skip to content

Instantly share code, notes, and snippets.

@erfg12
Last active February 16, 2020 01:56
Show Gist options
  • Save erfg12/b7c5e90ad65e50b1946c74f96e6fa92a to your computer and use it in GitHub Desktop.
Save erfg12/b7c5e90ad65e50b1946c74f96e6fa92a to your computer and use it in GitHub Desktop.
Iterate through a string, explode by commas.
// Iterate through a string, explode by commas.
text = argument0;
char_string = 0;
if string_pos(",", text) != 0
{
var cc = string_count(",",text);
for (i = 0; i <= cc; i += 1) {
if (i < cc) {
char_string[i] = string_copy(text, 0, string_pos(",", text)-1 );
text = string_copy(text, string_pos(",", text)+1, string_length(text) );
}
else
char_string[i] = text;
}
return char_string;
}
else
return text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment