60aside Posted October 17, 2009 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.
Zedna Posted October 17, 2009 Posted October 17, 2009 $text = "SBRPILKPS005 - (Camaçari)" $text = StringSplit($text, ' - ') MsgBox(0,'result',$text[1]) Resources UDF ResourcesEx UDF AutoIt Forum Search
BugFix Posted October 17, 2009 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
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