Hi folks, I have trouble with TrimEnd.
I have a string where last character should be %
I want to remove text after the las time in string where % is.
Tried with myString.TrimEnd("%“c) and myString.TrimEnd(”%"c).toString, but I can not remove the text after %
Hi @kare.smorvik, you can also try regex, where the pattern could be e.g. “(.+%)” - please see the below test results, where you are getting rid of the part after the last %:
Hi, realised that this remove text after the first % so I loose everything after. Only want to remove end of string after last%.
If string is like abcde%fghij%klmno%pqr. Only want to trim %qpr and keep last % so output looks ltke this: abcde%fghij%klmno%