string class : TrimEnd(string) method

Description

Returns a string that removed specified characters at the end of the caller.

Syntax

stringInstance.TrimEnd(string charList)

Arguments

ClassNameDescription
stringcharListCharacters to remove.

Return value

ClassDescription
stringA string that removed specified characters at the end.

Sample code

1:

string org = "abcbcDDDDDDcbabb";

2:

string result = org.TrimEnd("abc"); // result is "abcbcDDDDDD".

It is not "abc" that was deleted. 'a', 'b', and 'c' were removed.

Notes

The individual characters in the argument string are removed regardless of their appearance order.

Links for reference

None

Copyright © Rice All rights reserved.