Last active
February 16, 2020 01:56
-
-
Save erfg12/b7c5e90ad65e50b1946c74f96e6fa92a to your computer and use it in GitHub Desktop.
Iterate through a string, explode by commas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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