TextUtils.Substring Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Substring(ICharSequence, Int32, Int32) |
Create a new String object containing the given range of characters from the source string. |
| Substring(String, Int32, Int32) |
Create a new String object containing the given range of characters from the source string. |
Substring(ICharSequence, Int32, Int32)
Create a new String object containing the given range of characters from the source string.
[Android.Runtime.Register("substring", "(Ljava/lang/CharSequence;II)Ljava/lang/String;", "")]
public static string? Substring(Java.Lang.ICharSequence? source, int start, int end);
[<Android.Runtime.Register("substring", "(Ljava/lang/CharSequence;II)Ljava/lang/String;", "")>]
static member Substring : Java.Lang.ICharSequence * int * int -> string
Parameters
- source
- ICharSequence
The text from which to take characters.
- start
- Int32
The first character index to include.
- end
- Int32
The character index at which the range stops, excluding that character.
Returns
The selected characters as a string without source span objects.
- Attributes
Remarks
Create a new String object containing the given range of characters from the source string. This is different than simply calling CharSequence#subSequence(int, int) CharSequence.subSequence in that it does not preserve any style runs in the source sequence, allowing a more efficient implementation.
Java documentation for android.text.TextUtils.substring(java.lang.CharSequence, int, int).
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
Substring(String, Int32, Int32)
Create a new String object containing the given range of characters from the source string.
public static string? Substring(string? source, int start, int end);
static member Substring : string * int * int -> string
Parameters
- source
- String
The text from which to take characters.
- start
- Int32
The first character index to include.
- end
- Int32
The character index at which the range stops, excluding that character.
Returns
The string value for the selected character range.
Remarks
Create a new String object containing the given range of characters from the source string. This is different than simply calling CharSequence#subSequence(int, int) CharSequence.subSequence in that it does not preserve any style runs in the source sequence, allowing a more efficient implementation.
Java documentation for android.text.TextUtils.substring(java.lang.CharSequence, int, int).
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.