60aside Posted October 17, 2009 Share Posted October 17, 2009 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. Link to comment Share on other sites More sharing options...
Zedna Posted October 17, 2009 Share Posted October 17, 2009 $text = "SBRPILKPS005 - (Camaçari)" $text = StringSplit($text, ' - ') MsgBox(0,'result',$text[1]) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
BugFix Posted October 17, 2009 Share Posted October 17, 2009 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 Link to comment Share on other sites More sharing options...
60aside Posted October 17, 2009 Author Share Posted October 17, 2009 Great, That works fine. Thanks guys. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now