How to detect a space in verse string

I had an idea on how to detect a space char in a verse string, like so:

if(ThisChar = " "):
# Run code here

# ‘ThisChar’ is a character in any point in a given string.

But the code seems to not work. Any solutions?

if (ThisChar = " ") is comparing a char type to a string type, which is why it always fails. Here are two ways you could get this comparison to work.

# (1) Use single quote marks which denotes a char type. This way you're comparing char to char.
if (ThisChar = ' ')

# (2) Turn the char back into a string. This way you're comparing string to string.
if ("{ThisChar}" = " ")
3 Likes

ah silly me, don’t know how I didn’t see that lol!

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