Jump to content
Sign in to follow this  

help with stripping text from a string

Recommended Posts



I'm relatively new to Autoit, and can't find anything to help me in the help file.

Basically I have a number of strings similar to this:-

"SBRPILKPS005 - (Camaçari)"

and I would like to strip everything apart from the server name (the server names vary in length) so that i am just left with :-


Should be easy for you guys?


Share this post

Link to post
Share on other sites

If in every cases it looks like this scheme: "SERVERNAME - other_text"

you can do this:

Local $string = "SBRPILKPS005 - (Camaçari)"
Local $split = StringSplit($string, ' - ', 1)
MsgBox(0, '', 'Server name: ' & $split[1])

Best Regards BugFix  

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.