Is there any way to search for a specific value inside of a string? In my blueprint, I’m having it detect whether a combo is used by adding the keys pressed to a string and then searching the string to see if it contains the correct keys. The issue with this seems to be that Find/Get Substring only seem to look at whether the string contains the requested value. For example:
If I were to enter “1234”, the combo works fine, however if I were to enter “11234”, it still works as if I had put in the right code. I thought that the ‘length’ parameter of Get Substring would have something to do with this, but it doesn’t seem to make a difference. Does anyone know how to fix this issue?
Try out the Equal(String) node. Should do the trick!
This is exactly what you want I’m guessing. If it’s not then please rephrase your question and I’ll help.
Not sure why I got downvoted… If you want to compare the string then just don’t bother with substring and get substring nodes. Just use the equals(string) node.
I know that feeling haha thanks!
Duh, of course that’s the solution- it was so obvious, I just got some serious tunnelvision and didn’t see it; thanks for the help!
(Not sure who downvoted you, upvoted for good measure!)
It’s even easier. Just use “Contains” node, it does exactly that.
tehhax’s answer alone is not enough. But if you’d check this string after every button press, then you can also use the node “Right” which gives back the most right # chars in the string. And if you say you’d get the right 4 chars, then you could check if it is equal to “1234”.
Better you make a new macro
and if you want it exact just delete these “To lower”