SpannableStringBuilder.Replace 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 |
|---|---|
| Replace(Int32, Int32, String, Int32, Int32) | |
| Replace(Int32, Int32, ICharSequence, Int32, Int32) |
Replaces the specified range ( |
| Replace(Int32, Int32, String) | |
| Replace(Int32, Int32, ICharSequence) |
Convenience for replace(st, en, text, 0, text.length()) |
Replace(Int32, Int32, String, Int32, Int32)
public Android.Text.IEditable? Replace(int start, int end, string? tb, int tbstart, int tbend);
member this.Replace : int * int * string * int * int -> Android.Text.IEditable
Parameters
- start
- Int32
- end
- Int32
- tb
- String
- tbstart
- Int32
- tbend
- Int32
Returns
Remarks
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
Replace(Int32, Int32, ICharSequence, Int32, Int32)
Replaces the specified range (st…en) of text in this
Editable with a copy of the slice start…end from
source.
[Android.Runtime.Register("replace", "(IILjava/lang/CharSequence;II)Landroid/text/SpannableStringBuilder;", "GetReplace_IILjava_lang_CharSequence_IIHandler")]
public virtual Android.Text.IEditable? Replace(int start, int end, Java.Lang.ICharSequence? tb, int tbstart, int tbend);
[<Android.Runtime.Register("replace", "(IILjava/lang/CharSequence;II)Landroid/text/SpannableStringBuilder;", "GetReplace_IILjava_lang_CharSequence_IIHandler")>]
abstract member Replace : int * int * Java.Lang.ICharSequence * int * int -> Android.Text.IEditable
override this.Replace : int * int * Java.Lang.ICharSequence * int * int -> Android.Text.IEditable
Parameters
- start
- Int32
- end
- Int32
- tbstart
- Int32
- tbend
- Int32
Returns
a reference to this object.
Implements
- Attributes
Remarks
Replaces the specified range (st…en) of text in this Editable with a copy of the slice start…end from source. The destination slice may be empty, in which case the operation is an insertion, or the source slice may be empty, in which case the operation is a deletion.
Before the change is committed, each filter that was set with setFilters(InputFilter) is given the opportunity to modify the source text.
If source is Spanned, the spans from it are preserved into the Editable. Existing spans within the Editable that entirely cover the replaced range are retained, but any that were strictly within the range that was replaced are removed. If the source contains a span with Spanned.SPAN_PARAGRAPH flag, and it does not satisfy the paragraph boundary constraint, it is not retained. As a special case, the cursor position is preserved even when the entire range where it is located is replaced.
Android reference for android.text.SpannableStringBuilder.replace.
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
Replace(Int32, Int32, String)
public Android.Text.IEditable? Replace(int start, int end, string? tb);
member this.Replace : int * int * string -> Android.Text.IEditable
Parameters
- start
- Int32
- end
- Int32
- tb
- String
Returns
Remarks
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
Replace(Int32, Int32, ICharSequence)
Convenience for replace(st, en, text, 0, text.length())
[Android.Runtime.Register("replace", "(IILjava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;", "GetReplace_IILjava_lang_CharSequence_Handler")]
public virtual Android.Text.IEditable? Replace(int start, int end, Java.Lang.ICharSequence? tb);
[<Android.Runtime.Register("replace", "(IILjava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;", "GetReplace_IILjava_lang_CharSequence_Handler")>]
abstract member Replace : int * int * Java.Lang.ICharSequence -> Android.Text.IEditable
override this.Replace : int * int * Java.Lang.ICharSequence -> Android.Text.IEditable
Parameters
- start
- Int32
- end
- Int32
Returns
Implements
- Attributes
Remarks
Convenience for replace(st, en, text, 0, text.length())
Android reference for android.text.SpannableStringBuilder.replace.
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.