Jump to content

Split string


Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...