explode_real
Returns an array of real values parsed from a given string of elements separated by a delimiter.
numbers = "10,21,13,3,18,15";
array = explode(",", numbers);
// array[0] == 10
// array[1] == 21
// array[2] == 13
// array[3] == 3
// array[4] == 18
// array[5] == 15
- explode_real(delimiter,string)
- Returns an array of real values parsed from a given string of elements separated by a delimiter.
COPY/// explode_real(delimiter,string)
//
// Returns an array of real values parsed from a given
// string of elements separated by a delimiter.
//
// delimiter delimiter character, string
// string group of elements, string
//
/// gmlscripts.pro/license
{
var arr;
var del = argument0;
var str = argument1 + del;
var len = string_length(del);
var ind = 0;
repeat (string_count(del, str)) {
var pos = string_pos(del, str) - 1;
arr[ind] = real(string_copy(str, 1, pos));
str = string_delete(str, 1, pos + len);
ind++;
}
return arr;
}
Contributors: xot
GitHub: View · Commits · Blame · Raw