myspacee Posted May 22, 2009 Share Posted May 22, 2009 Hello to all, joking with string and try to split a line. Know stringsplit power, but not usefull in my last script. I must separe string that stay after '=' symbol to use in other task. Post little script with a GUI and a label to separate. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <GUIConstants.au3> #include <String.au3> #include <WindowsConstants.au3> $text_to_split = "1004=bear" Global $texpad_gui = GUICreate("TwoStick", 300, 300, 0, 0) Global $Label1 = GUICtrlCreateLabel($text_to_split, 2, 2, 30, 30, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUISetState(@SW_SHOW) while 1 sleep(250) WEnd Anyone can teach me how to separate this string without using array ? (only word bear must appear in label) Thank you, m. Link to comment Share on other sites More sharing options...
weaponx Posted May 22, 2009 Share Posted May 22, 2009 $str = "key=value" MsgBox(0,"",StringLeft($str,StringInStr($str,"=")-1) & @CRLF & StringTrimLeft($str,StringInStr($str,"="))) Link to comment Share on other sites More sharing options...
oMBRa Posted May 22, 2009 Share Posted May 22, 2009 $String = '1004=bear' $a = StringRegExpReplace($String, '(.*)=(\w+)', '\2') MsgBox(0, '', $a) 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