SEARCHB

Description

SERACHB locates the position of the first byte of a specified text string within another text string.

Syntax

SEARCHB ( search_text, text [, start_position] )

 

Parameter

Description

search_text

The text to find. To search for an asterisk or question mark, include a tilde (~) before the character.

The search string can contain wildcards. The available wildcard characters are * (asterisk), which matches any sequence of characters, and ? (question mark), which matches any single character.

Text

The text to be searched.

start_position

The byte position where the search begins. If the number you specify is less than 0 or greater than the number of bytes in text, #VALUE! is returned. Omitting this argument assumes a starting position of 1.

Remarks

Text is searched from left to right, starting at the position specified. The search is not case-sensitive. If text does not contain the search string, #VALUE! is returned.

Examples

This function returns 6:

SEARCHB("?5", "Bin b45")

This function returns 5:

SEARCHB("b", "Bin b45", 4)

With Latin letters, one character is one byte. That is why SEARCHB and SEARCH are identical.

 Note:

If an Invalid formula syntax warning appears, check whether the comma is set as the list separator in your regional settings on the Windows Control Panel. If a different character is set as the list separator, use this character in the above examples in place of the comma. (Windows XP: Access the Windows Control Panel and select Regional and Language Options. On the Regional Options tab page, click Customize. On the Numbers tab page, check which character is the default list separator on your computer. Use this character in the above examples instead of the comma.