victor Posted May 12, 2008 Share Posted May 12, 2008 how do I separate part of the string $var="12345|99" how to separate or get 99 from $var ?? Thanks in advance Link to comment Share on other sites More sharing options...
Zedna Posted May 12, 2008 Share Posted May 12, 2008 Look at StringSplit() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Immensee Posted May 12, 2008 Share Posted May 12, 2008 hi, i suggest using StringSplit(). This can split a part of a string using a 'delimiter'. This delimiter is a picked character. example: $var = StringSplit("12345|99", "|") If Not $var[0] = 1 Then For $x=1 To $var[0] MsgBox(0, "", $var[$x]) Next EndIf EXPLANATION: The stringsplit command splits the string "12345|99" with the delimiter "|". The results (which is an array) is put into $var. $var[0] ALWAYS shows how many elements are found. If $var[0] equals 1 means that NO occurences where found and the whole string is returned back to $var[1]. If there are more delimiters found it will be split into 1,2,3, etc. and the number of elements put into $var[0] hope that helps immense Link to comment Share on other sites More sharing options...
victor Posted May 12, 2008 Author Share Posted May 12, 2008 hi, i suggest using StringSplit(). This can split a part of a string using a 'delimiter'. This delimiter is a picked character. example: $var = StringSplit("12345|99", "|") If Not $var[0] = 1 Then For $x=1 To $var[0] MsgBox(0, "", $var[$x]) Next EndIf EXPLANATION: The stringsplit command splits the string "12345|99" with the delimiter "|". The results (which is an array) is put into $var. $var[0] ALWAYS shows how many elements are found. If $var[0] equals 1 means that NO occurences where found and the whole string is returned back to $var[1]. If there are more delimiters found it will be split into 1,2,3, etc. and the number of elements put into $var[0] hope that helps immense Thanks for the fast reply 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