Jump to content

Recommended Posts

Posted

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)
Posted

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.

Posted

result &= ' - Autoit.'

Posted

Using a sledgehammer to crack a walnut?

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

WBD

Posted

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

Posted

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
  • Recently Browsing   0 members

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