Good morning I have the following text string in a variable
cad = "perro AND gato AND pajaro AND vaca AND"
As the chain is created automatically, it always adds the AND when concatenating a new element, but to display it, it must be left without the last AND.
How can I remove the last AND of the string?
If you didn't know the length of the last word:
If you know that the last thing in the chain is AND , you can do the following:
You could also see how you're concatenating so it doesn't add the last AND.
I hope it helps you.
That is my solution. Please read the comments in the code.
Hello, you can do the following, as long as you know that at the end leave and + a space.