implode_string
/*
** Usage:
** implode_string(sep,array,size)
**
** Arguments:
** sep string used to between elements
** array name of an array given as a string
** size number of elements in the array
**
** Returns:
** a string comprised of each element of the given local
** array of strings seperated by the given seperator
**
** GMLscripts.com
*/
{
var sep,arr,num,out,ind;
sep = argument0;
arr = argument1;
num = argument2;
out = "";
ind = 0;
repeat (num) {
out += variable_local_array_get(arr,ind)+sep;
ind += 1;
}
out = string_copy(out,1,string_length(out)-string_length(sep));
return out;
}
** Usage:
** implode_string(sep,array,size)
**
** Arguments:
** sep string used to between elements
** array name of an array given as a string
** size number of elements in the array
**
** Returns:
** a string comprised of each element of the given local
** array of strings seperated by the given seperator
**
** GMLscripts.com
*/
{
var sep,arr,num,out,ind;
sep = argument0;
arr = argument1;
num = argument2;
out = "";
ind = 0;
repeat (num) {
out += variable_local_array_get(arr,ind)+sep;
ind += 1;
}
out = string_copy(out,1,string_length(out)-string_length(sep));
return out;
}
[Please Login]
Projects: 4
Contributor: xot
comments powered by Disqus

Related: