Link to home
Start Free TrialLog in
Avatar of bmatumbura
bmatumbura

asked on

VB.NET RTrim

Dear Experts,

In VB.NET, there is this function:

String.Trim(array<Char>)

which removes all leading and trailing occurrences of a set of characters specified in an array from the current String object.

It looks like there are no RTrim and LTrim equivalents. I need function

RTrim(array<Char>)

that removes the specified array of characters from the end of a string.
Avatar of JPJ78
JPJ78
Flag of Sweden image

TrimEnd = RTrim
TrimStart = LTrim
Avatar of bmatumbura
bmatumbura

ASKER

JPJ78:

The LTrim function only strips leading spaces and the RTrim function only strips trailing spaces from a string variable.

I want a function that not only strips SPACES but also other characters like what the String.Trim function does. For example:

RTrim("boxter8366#", "#")

should return: "boxter866"

and

RTrim("boxter8366#", "#6")

should return: "boxter83"
ASKER CERTIFIED SOLUTION
Avatar of JPJ78
JPJ78
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial