次の方法で共有


String.StripTrailing Method

Definition

Returns a string whose value is this string, with all trailing Character#isWhitespace(int) white space removed.

[Android.Runtime.Register("stripTrailing", "()Ljava/lang/String;", "", ApiSince=33)]
public string StripTrailing ();
[<Android.Runtime.Register("stripTrailing", "()Ljava/lang/String;", "", ApiSince=33)>]
member this.StripTrailing : unit -> string

Returns

a string whose value is this string, with all trailing white space removed

Attributes

Remarks

Returns a string whose value is this string, with all trailing Character#isWhitespace(int) white space removed.

If this String object represents an empty string, or if all characters in this string are Character#isWhitespace(int) white space, then an empty string is returned.

Otherwise, returns a substring of this string beginning with the first code point of this string up to and including the last code point that is not a Character#isWhitespace(int) white space.

This method may be used to trim Character#isWhitespace(int) white space from the end of a string.

Added in 11.

Java documentation for java.lang.String.stripTrailing().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to