Jump to content
Sign in to follow this  
myspacee

stringsplit without array

Recommended Posts

myspacee

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.

Share this post


Link to post
Share on other sites
oMBRa

$String = '1004=bear'
$a = StringRegExpReplace($String, '(.*)=(\w+)', '\2')
MsgBox(0, '', $a)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.