Community discussions

MikroTik App
 
ibn
just joined
Topic Author
Posts: 7
Joined: Sat Sep 29, 2007 3:43 pm

can I split a string

Fri Oct 19, 2007 6:36 pm

I just want to find an IP address in /ip fire connection

but src-address is in a form like 192.168.0.5:88 , i.e., IP:Port

I just want the IP only.

I thought of 192.168.0.5:88 . "\b" and it worked in terminal,
but in log, \b appears like a black dot.


is there a function to split string ?
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: can I split a string

Fri Oct 19, 2007 8:28 pm

:global ip 192.168.1.1:88
:put [:pick $ip 0 [:find $ip ":"]
 
ibn
just joined
Topic Author
Posts: 7
Joined: Sat Sep 29, 2007 3:43 pm

Re: can I split a string

Sat Oct 20, 2007 12:53 pm

thanks. it's very kind of you to answer my simple question

Who is online

Users browsing this forum: GoogleOther [Bot] and 27 guests