String operations

Hello Guys!

I have strings like “something1%something2”, I need to retrieve “something2”. Example : let say I have this string “188.138.100.10%main_ether”, I need a function that will retrieve the second part : “main_ether”. How to do this using RouterOS built in scripting language. I can’t find built in functions which can manipulate with strings :frowning:

Thank you

sure it is easy :wink:

{ 
:local str "something1%something2"; 
:put [:pick $str ([:find $str "%"]+1) ([:len $str])];   
}

Hi there

same question but how can someone get “something1” part? The scripting manual is hard to understand with :pick and :find. Can you please help?

Thanx