Jump to content
Sign in to follow this  
ausssieautomate

StringSplit Query

Recommended Posts

ausssieautomate

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)

Share this post


Link to post
Share on other sites
Khab

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.

Share this post


Link to post
Share on other sites
CodyBarrett

result &= ' - Autoit.'

Share this post


Link to post
Share on other sites
WideBoyDixon

Using a sledgehammer to crack a walnut?

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

WBD

Share this post


Link to post
Share on other sites
CodyBarrett

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

Share this post


Link to post
Share on other sites
ausssieautomate

Hi Guys,

Thx for that problem solved.

^_^


Frequent sufferer of ID10T Syndrome and CRAFT (Can't Remember A "BLEEP" Thing)

Share this post


Link to post
Share on other sites
CodyBarrett

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.