Splitting strings with a delimiter

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Splitting strings with a delimiter

Thermo
When I do:

local ip_split = String.split("10.11.12.13","\.",3)[1]

I get the error message:

attempt to index a string value
        site:/hi.html.luan line 43

If I just do local ip_split = String.split("10.11.12.13","\.",3), it seems to set ip_split to the string "10". How do I get 11, 12, and 13 from the string?
Reply | Threaded
Open this post in threaded view
|

Re: Splitting strings with a delimiter

fschmidt
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: Splitting strings with a delimiter

Thermo
It works, thanks.