How to separate strings and compare them

Hello,

I am trying to input an Arduino serial data, which is a string that returns either “x number” or “y number”, the number is a number between -500 and 500. What I’m trying to do here is to tell the blueprint to aknowledge if it has to move forward/backward or sideways depending of what letter it receives, x sideways, y forward/backwards. I am kinda new to Blueprints and I tried looking over the web for some answers and I found some useful but I’m still stuck.

What I’m trying to say is that I need to separate the y from the number and then make it compare only the letter to know what coordinates it has to move.

Here’s a screenshot of what I have at the moment:

Thanks in advance for checking this

There is a “Split” node that you can use. You can specifiy the character that it should split at, so if you know there is a space between x/y and the value, you can simply split at that space.

You should also be able to simply cast the string to a float, and the engine should be able to translate the value correctly, as long as it has a standard format