RichEdit.span

Overview | Methods | This Package | All Packages

RichEdit.span

Selects text in the RichEdit control based on a specified set of characters.

Syntax

public void span( String characterSet )

public void span( String characterSet, boolean forward )

public void span( String characterSet, boolean forward, boolean negate )

Parameters

characterSet

A string expression that specifies the set of characters to look for when extending the selection, based on the value of the negate parameter.

forward

Set to true to move the cursor forward in the text; otherwise, set to false. The default value for this parameter is true.

negate

Set to true to include in the selection those characters that are not in the character set. Set to false to include in the selection the characters that are in the character set. The default setting for this parameter is false.

Remarks

The following example illustrates how a call to this method determines which characters in a character set are selected.

Suppose that you want to span to the characters "dog" in a string that consists of the characters "My life as a dog". In this case, the characterSet parameter contains the string "dog".  If negate is set to true, all the characters up to the first character in "dog" are selected, but "dog" is not; the selection stops at the first character found in the character set. If negate is set to false, none of the text is selected, because the selection stops at the first character not included in the character set (the first character in "My life as a dog").

See Also   moveInsertionPoint