I think the above expression doesn’t throw this exception because Split method returns 1 item at least and index 0 always exists. Did you get this exception using index 0? There might be something wrong except this expression.
Hi @Yoichi, I tried again after I saw your comment, and I actually used (1) in my case, since I was extracting the text after the delimiter.
When using (0), it’s returning all text as if “adam’s apple” doesn’t exist. When I use (1) however, that’s when it throws the error.
I provided the wrong example here but I’ll try to work out with what the people has provided so far, so that it captures the text after, and not before.
Hi @lrtetala I tried this out with the following:
textData.ToLower.Split({“adam’s apple”},StringSplitOptions.None)(1).ToString
but it didn’t work. I was actually getting the text after the delimiter though, so it’s a (1) and not (0). I made the wrong example in the post, but I assumed it would work if I just changed (0) to (1).
All right. Probably there is a slight diffrence between your input text and separator string, for example white space and/or apostrophe.
If you want to investigate your string in details, the following expression will help you.