i need to delete the last caractere in a sentence if is a space
Try to use
there are many spaces in the sentence i need only the last one
You can the below expression.
how can i do that only if there is a space in the last caractere plz ?
Do it using conditional statement like, for example lets assume that the is a variable called name that holds the string of characters. Use the code as follow:
if(name.substring(length()-1)==“\n”) //this conditional statement check if the is a newline/empty space after the string
then you just use name.delete(length()-1)
That’s literally what TrimEnd does. It removes any extra spaces at the end. Try it.
Use an Assign activity like this:
Take a look here:
Hopefully this helps
If you use the below expression it will remove the last space.
Use this to delete last space character in string: our_String.TrimEnd