Freigeben über


String.StripLeading Method

Definition

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

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

Returns

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

Attributes

Remarks

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

If this String object represents an empty string, or if all code points 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 that is not a Character#isWhitespace(int) white space up to to and including the last code point of this string.

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

Added in 11.

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

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