Sign in to follow this  
Followers 0
60aside

help with stripping text from a string

4 posts in this topic

Hi,

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 :-

"SBRPILKPS005"

Should be easy for you guys?

Thanks.

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

Great,

That works fine.

Thanks guys.

:)

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  
Followers 0