Hello
Dynamiically allocated arrays are declared with 'string[] name'.
You should try this code:
int main() {
string str = "I am#*- a exa#*-mple string c#*-ontaini#*-ng
non#*-sense";
string[] sa = str.split("#*-");
foreach(string s in sa)
print("%s\n", s);
return 0;
}
> void str2bib(string str)
> { int i = count(str, @"$gs");
> string sflds[] = new string [i];
> sflds = str.split(@"$gs");
> }
> /** returns the number of times delim occurs within str */
> int count (string str, string delim)
> { int i, res;
> for (i = 0, res = 0; i <= str.length - delim.length; i
> ++)
> { if (str[i: i + delim.length] == delim) res++; }
> return res;
> }
>
>
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list