How to remove the last character of a string

Gary96

Member
Hi sahil_raina_91.
This works but unfortunately before this action I am setting the first two letters of two words to upper case. This action sets them as lowercase again. Dataitem1 = john-joe. I achieve this by splitting the text by "-" and then work with each word individually. I set the first letter of each word as uppercase and then use join text, to join them back on their separator. "-" . I needed your code to get rid of the extra "-" that was at the end of the joe. (John-Joe-) After your code, returns (john-joe)
 

sahil_raina_91

Active Member
Hi sahil_raina_91.
This works but unfortunately before this action I am setting the first two letters of two words to upper case. This action sets them as lowercase again. Dataitem1 = john-joe. I achieve this by splitting the text by "-" and then work with each word individually. I set the first letter of each word as uppercase and then use join text, to join them back on their separator. "-" . I needed your code to get rid of the extra "-" that was at the end of the joe. (John-Joe-) After your code, returns (john-joe)

That should not be the case.
If the result of the action before this is "John-Joe-" (Let's say this is stored in Text Data Item called : Name)
Then, Left([Name],Len([Name])-1) should result in "John-Joe" and NOT "john-joe"
 

Gary96

Member
That should not be the case.
If the result of the action before this is "John-Joe-" (Let's say this is stored in Text Data Item called : Name)
Then, Left([Name],Len([Name])-1) should result in "John-Joe" and NOT "john-joe"
Hi sahil_raina_91,
I updated the output to store in a text data item and the re-input it back into my collection. My problem was I saving the result straight back to the collection. Working now. Thank you for your help.
 
Top