Jump to content

StringSplit Query


Recommended Posts

Hi Guys,

This is real Noob question been playing around with StringSplit command, is it possible to keep the delimiter you split the string by in the final result.

For example

$Text = "Helloworld - Computer - AutoIT"

$array = StringSplit($text, "Computer", 1)

result = $Array[2]

Result = - AutoIT

Is their a way to get the result as "Computer - AutoIT."

Cheers

Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)
Link to comment
Share on other sites

Hi Guys,

This is real Noob question been playing around with StringSplit command, is it possible to keep the delimiter you split the string by in the final result.

For example

$Text = "Helloworld - Computer - AutoIT"

$array = StringSplit($text, "Computer", 1)

result = $Array[2]

Result = - AutoIT

Is their a way to get the result as "Computer - AutoIT."

Cheers

Since you know the delimiter anyway, you should be able to make

result = "Computer " & result;

I believe. There may be a better way but I'm not sure.

Link to comment
Share on other sites

result &= ' - Autoit.'

Link to comment
Share on other sites

Using a sledgehammer to crack a walnut?

$Text = "Helloworld - Computer - AutoIT"
$Result = StringMid($text, StringInStr($text, "Computer"))
MsgBox(64, "Result", $Result)

WBD

Link to comment
Share on other sites

that would work also.. there are MANY ways to do this

Link to comment
Share on other sites

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...