A question about "split"

So I want it tells me there is no "6" :pleading_face:
In real application, I split the string many times, when an error occurred, I don't know which is not exist

That's why selecting 2nd item throws error.

Check list length.
If greater than 1 then it means that particular item exists else not.

He did it as shown in the first post, but he doesn't like this solution, he wants a different one.
But I also think that the method will be the best there. You can also select it, make a procedure that will check the lists. Then it can be used in many places.

Besides, maybe it can be solved in a completely different way, we would have to know the author's intention.

What about following my previous advice then?

Taifun

I am :woman:...

OK I rewrote it!
Is it better? :crazy_face:

I have a lot to rewrite :joy:

You mean here? :pleading_face:


Or there is another way...?

Write what do you need? Do you want to search for text in a list or in a string?

string=123456789
need after "2"
→string=3456789
need after "5"
→string=6789
need before "8"
→string=67→what I need

Today one of "2","5","8" is changed (or all of them changed)
I need to know which, or I have to check many times

Try it:

use:

blocks (76)

Thank you Patryk_F :smiling_face_with_three_hearts:

  • When I find "2"(index2), "5"(index2), "8"(index1) in "123456789"
    It works → 67
  • When I find "2"(index2), "0"(index2), "8"(index1) in "123456789"
    It works → ERROR IN BLOCK 0, NO INDEX 2
  • But when I find "2"(index2), "5"(index2), "0"(index1) in "123456789"
    It shows → 6789
    It don't know "8" has been changed

When index 1, there is still a little problem :thinking:

Thank you Juan_Antonio :smiley:

  • When I find "2"(after), "5"(after), "8"(before) in "123456789"
    It works → 67
  • When I find "2"(after), "0"(after), "8"(before) in "123456789"
    It shows → Not contain
    I need it to tell me "5" has been changed
    I tried to replace "Not contain" with "No (get at)"
    It shows → No 8 (not No 0)(because "8" is the last :sweat_smile:)

When you write:

"2"(after), "0"(after), "8"(before) in "123456789"

what should you get?

Oh, sorry, I was wrong
"I need it to tell me "5" has been changed" is incorrect
Anyway, when I write:"2"(after), "0"(after), "8"(before) in "123456789"
I need an alert: "There is no 0"


blocks (79)

1 Like

2 Likes

:crazy_face:

Thank you Patryk_F :smiling_face_with_three_hearts:
Your blocks are better than mine
I just made a small change


Then your blocks show "error in block 0", "error in block 98"
My blocks only show "error in block 0"
Your blocks are more convenient

Thank you Juan_Antonio :smiling_face_with_three_hearts:
I have learned a lot

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