ParseIntoArray bugged?

Howdie,

trying to get ParseIntoArray to work.

Simple test:

Setup a string variable in a blueprint: “1-2-3”

Feeding that to ParseIntoArray, setting the delimiter to -

result: An array with one index, content: “1-2-3”

Do i misunderstand the function, or is this a bug?

Thx & cheers

Sarge

Hi Swiss_Sarge,

Can I see how you have it set up? This seems to be working as intended on my end.

Let me see → Link to the screenshot. link text

Ah, what you want to do to see the parsed array is run the array through a for each loop and use a print string to print the array element output from the foreach loop. then it will print out:

1
2
3

instead of 1-2-3. See if that works for you.

Let me get my undestanding right …

ParseIntoArray

gets a String and a Delimiter String.

With these 2 parameters, it is expected to return an array of strings.

So in my above example:

String: “1-2-3”
Delimiter: “-”

Expected output of the function:

Array with
(0) “1”
(1) “2”
(2) “3”

What it returns instead is:
(0) “1-2-3”

In my screenshot i dont print the array values, i am checking the array length - anything != 3 would be wrong …

Is my understanding of the function wrong?

No your understanding is correct. I just tested the print length and it is working ok on my end. In your delimiter do you have any spaces before or after the -? They are counted in the delimiting process and if there are spaces in the original string you may have to add them to the delimiter or take them out of the original string. I am attaching a screenshot of what I have setup that is working:

That small hint fixed it :slight_smile: The input field for the delimiter had a blank at the beginning, which i didnt realize when entering the delimiter.

Wrote my own string parser in the last 20 mins, might take that now for the basis for a regex parser :slight_smile:

Thx again!