最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

findText Method

Internet Development Index

Searches for text in the document and positions the start and end points of the range to encompass the search string.

Syntax

bFound = TextRange.findText(sText [, iSearchScope] [, iFlags])

Parameters

sText Required. String爐hat specifies the text to find.
iSearchScope Optional. Integer爐hat specifies the number of characters to search from the starting point of the range. A positive integer indicates a forward search; a negative integer indicates a backward search.
iFlags Optional. Integer爐hat specifies one or more of the following flags to indicate the type of search:
0Default. Match partial words.
1Match backwards.
2Match whole words only.
4Match case.
131072Match bytes.
536870912Match diacritical marks.
1073741824Match Kashida character.
2147483648Match AlefHamza character.

Return Value

Boolean that returns one of the following values:

trueThe search text was found.
falseThe search text was not found.

Remarks

A range has two distinct states: degenerate and nondegenerate.

A degenerate range is like a text editor caret (insertion point) —it does not actually select any characters. Instead, it specifies a point between two characters. The end points of a degenerate range are adjacent.

A nondegenerate range is like a text editor selection, in that it selects a certain amount of text. The end points of a nondegenerate range are not adjacent.

The value passed for the iSearchScope parameter controls the part of the document, relative to the range, that is searched. The behavior of the findText method depends on whether the state is degenerate or nondegenerate:

  • If the range is degenerate, passing a large positive number causes the text to the right of the range to be searched. Passing a large negative number causes the text to the left of the range to be searched.
  • If the range is nondegenerate, passing a large positive number causes the text to the right of the start of the range to be searched. Passing a large negative number causes the text to the left of the end of the range to be searched. Passing 0 causes only the text selected by the range to be searched.

This feature might not be available on non-Microsoft® Win32® platforms.

A text range is not modified if the text specified for the findText method is not found.

Example

This example creates a TextRange over the body of the document, and then uses the findText method to search for text with various flag combinations. The results are indicated in the example code comments.

<HTML>
<BODY>
Leonardo da Vinci was one of the great masters of the High
Renaissance, especially in painting, sculpture, architecture,
engineering, and science.
</BODY>
</HTML>
<SCRIPT>
var oRange = document.body.createTextRange();
// record the current position in a bookmark
var sBookMark = oRange.getBookmark();
// true - case-insensitive and partial word match
oRange.findText('leo');
// reset the range using the bookmark
oRange.moveToBookmark(sBookMark);
// false - matches whole words only
oRange.findText('engineer', 0, 2);
oRange.moveToBookmark(sBookMark);
// false - case-sensitive
oRange.findText('high', 0, 4);
oRange.moveToBookmark(sBookMark);
// true - case-sensitive and matches whole words
oRange.findText('Leonardo', 0, 6);
// the degenerate case
oRange.moveToBookmark(sBookMark);
// make the range degenerate
oRange.collapse();
// false - must specify large character count in this case
oRange.findText('Leonardo', 0, 6);
// true - no third parameter passed, so no count needed
oRange.findText('Leonardo');
// true - a large count covers the range
oRange.findText('Leonardo', 1000000000, 6);
</SCRIPT>

Standards Information

There is no public standard that applies to this method.

Applies To

TextRange
美姑县| 昌乐县| 泰顺县| 芦溪县| 永州市| 资溪县| 保亭| 汽车| 澄城县| 怀柔区| 资源县| 元谋县| 班戈县| 永靖县| 双牌县| 黎平县| 泸州市| 灵丘县| 邵武市| 哈巴河县| 敖汉旗| 旬邑县| 康保县| 芦山县| 漾濞| 湘西| 舒兰市| 弥勒县| 开阳县| 桂林市| 新郑市| 雷州市| 沈丘县| 潜江市| 个旧市| 大新县| 镇江市| 仲巴县| 毕节市| 海丰县| 扶余县|