How to remove trailing character

I tried a few things to remove this trailing “a”. But nothing seems to work. The last thing i tried was
StrVar.Substring(0, StrVar.Length-1).trim


If your string exactly ends with “a”, the following will work.


If there are possibility some whitespaces exists at the end of the string, can you try the following?

StrVar.TrimEnd({"a"c," "c,chr(10),chr(13)})


Winner, winner, chicken dinner… the second solution worked. Thanks!

1 Like

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