I would like to trim a \\ character from the end of the string. How is this done?
MyString.Value.TrimEnd('\');
simple doesn't work, and produces a newline in constant error, please help
Change this to
MyString.Value.TrimEnd('\\');
The slash has to be escaped.
\\
is an escape character, use \\\\
instead.
Bobby
这应该工作:
MyString.Value.TrimEnd((char)92);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.