Check from an index whether the next elements to its right side (with limit, of course) are filled within a string

How can I check within a string type variable whether from an index which would be the “i” in red whether the one on the right (In blue) is filled within this variable or empty counting just a few more spaces (Indexes):
Widget

The index to start searching is: (Just an example: “35”) which would result in the element: “i” being red in the sentence, and from there I want to see if next to it is filled within the string. Whether it is a whole word or whether it has a few more free and filled spaces. In short: I want to check from an index if the next elements (With a limit, of course) are filled.

You can use substring. It takes in a start index and length.
substring

Yes, but is there any node or workaround that I can check if a certain space in a string is filled as an array element? whether it is 0 or 1.

In the case of “Is not” it would be something like: 110111
Widget

You could use FString::Find on the return of the substring to check if it contains the needed element.
Or you could split the string into an array and then granularny step over it checking if the current letter is even to the letter of your needed entry.

The find would be cheaper but it would not take into account where in the substring the element is (though you can set a start position)

1 Like

Thank you for your answer! :grinning:

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