Split on whitespace : return errors after (0)

I have a string var :

“I’d like to split this string”

Assign :
strArray = split(StrVar, " ")

Writeline :
strArray(0)
Returns = “I’d”

Writeline:
strArray(1)
Returns error: Write Line: Index was outside the bounds of the array

Any idea what im doing wrong? Im trying to just grab the first 2 words in a string, split on whitespace.

Try this:

Writeline: strArray(1).ToString

:slight_smile:

I thought it wouldn’t matter as its an array of strings ?

but I get the same error :frowning:

Damn ye, sorry I though it was the reason but no… Maybe UiPath bug? Have you tried to close it and rerun that test?

Look this screenshot:

Hope it helps mate

1 Like

ha that actually fixed it ! been stressing for over an hour on this lol, ty pal much appreciated

1 Like

Wow haha!! Those things happens XD

Glad to have been useful

Regards,
Pablo

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.