Jump to content
Sign in to follow this  
gazkin

Split string

Recommended Posts

gazkin

Hi Guys,

I want to split a sentence in a array that contains all words used in the sentence.

If I use this script

$text = StringReplace("this is a line of text", " ", " ")

MsgBox(0, "New string is", $text[1])

It tells me that $text doesnt contain an array.

How to handle this?

Share this post


Link to post
Share on other sites
DMEE

StringReplace returns a new string according to the help file.

I guess you need:

#Include <String.au3>

$text = _StringSplit("this is a line of text", " ")


In the beginning there was nothing and then even that exploded - anonymous

Share this post


Link to post
Share on other sites
GaryFrost

StringReplace returns a new string according to the help file.

I guess you need:

#Include <String.au3>

$text = _StringSplit("this is a line of text", " ")

Just use the built in function StringSplit, _StringSplit is obsolete and will be gone from the next version.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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.