[Gambas-user] Split Strings
Werner Staudacher
gambas-user at lists.sourceforge.net
Mon Jan 9 00:13:33 CET 2006
mm at ...1313... schrieb:
>
>Hi Gambas Users,
>
>I have got an array containing some string in the following format:
>
>IPADDR[0]="192.168.1.10"
>NETMASK[0]="255.255.255.0"
>IPADDR[1]="192.168.10.16"
>NETMASK[1]="255.255.255.248"
>...
>
>
>I need to isolete the number within [] and transform it to an integer
>variable. Can I use the split command or do I have do use regexp
>
>Best Regards
>Marcus
>
>
Hi Marcus
Split does not work for this sense.
Regexp is allways a good solution to extract a part within strings.
A simple solution i have see ones somewhere could also be: numb = val(
mid( somestring, instr(somestring,"[")+1 ) ), but is maybe more vb like
then gambas.
Regards, staudi
More information about the User
mailing list