Język

InputConnectionWrapper.DeleteSurroundingText(Int32, Int32) Method

Definition

Delete beforeLength characters of text before the current cursor position, and delete afterLength characters of text after the current cursor position, excluding the selection.

[Android.Runtime.Register("deleteSurroundingText", "(II)Z", "GetDeleteSurroundingText_IIHandler")]
public virtual bool DeleteSurroundingText(int beforeLength, int afterLength);
[<Android.Runtime.Register("deleteSurroundingText", "(II)Z", "GetDeleteSurroundingText_IIHandler")>]
abstract member DeleteSurroundingText : int * int -> bool
override this.DeleteSurroundingText : int * int -> bool

Parameters

beforeLength
Int32

The number of characters to be deleted before the current cursor position.

afterLength
Int32

The number of characters to be deleted after the current cursor position.

Returns

true on success, false if the input connection is no longer valid.

Implements

Attributes

Remarks

Delete beforeLength characters of text before the current cursor position, and delete afterLength characters of text after the current cursor position, excluding the selection. Before and after refer to the order of the characters in the string, not to their visual representation: this means you don't have to figure out the direction of the text and can just use the indices as-is.

Java documentation for android.view.inputmethod.InputConnectionWrapper.deleteSurroundingText(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