14.06.2011, 07:59
How to split string to array? Like nospace.
forward split(const strsrc[], strdest[][], delimiter);//at the top script public split(const strsrc[], strdest[][], delimiter) { new i, li; new aNum; new len; while(i <= strlen(strsrc)){ if(strsrc[i]==delimiter || i==strlen(strsrc)){ len = strmid(strdest[aNum], strsrc, li, i, 128); strdest[aNum][len] = 0; li = i+1; aNum++; } i++; } return 1; }
new cash[128];
new cash2[9][64];
format(cash,128,"$00000000");
split2(cash, cash2, '|');
printf("%d",sizeof(cash2)); // <= i Get 9
new Pcash3[128];
format(Pcash3,128,"123");
new Pcash2[9][64];
split2(Pcash3, Pcash2, '|');
printf("%d",sizeof(Pcash2)); // <= i Get 9 to any idea why?