Related Topics: | ||
Description: Returns the number of the double-byte character at which a specific character or text string is first found, reading from left to right. SEARCHB is not case sensitive and can include wildcard characters.
SEARCHB is intended for use with languages that use the double-byte character set (DBCS). SEARCHB counts each double-byte character as 2 when you have enabled the editing of a language that supports DBCS and then set it as the default language. Otherwise, SEARCHB counts each character as 1.
Syntax: SEARCHB(Find_text, Within_text, [Start_num])
Find_text is the text you want to find.
Within_text is the text in which you want to search for Find_text.
Start_num is the character number in Within_text at which you want to start searching.
Remarks:
Use SEARCHB to determine the location of a character or text string within another text string so that you can use the REPLACEB function to change the text.
SEARCHB is not case sensitive. If you want to do a case sensitive search, you can use FINDB.
You can use the wildcard characters, question mark (?) and asterisk (*), in Find_text. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
If Find_text is not found, the #VALUE! error value is returned.
If Start_num is omitted, it is assumed to be 1.
Start_num must be greater than 0 (zero) and less than or equal to the length of Within_text.
Use Start_num to skip a specified number of characters. Using SEARCH as an example, suppose you are working with the text string "AYF0093.YoungMensApparel". To find the number of the first "Y" in the descriptive part of the text string, set Start_num equal to 8 so that the serial-number portion of the text is not searched. SEARCH begins with character 8, finds Find_text at the next character, and returns the number 9. SEARCH always returns the number of characters from the start of Within_text, counting the characters you skip if Start_num is greater than 1.
Example:
In the following example, SEARCHB returns 3 because each character is counted by its bytes; the first character has 2 bytes, so the second character begins at byte 3.
SEARCHB("", "") = 3
© 1992-2013. ReliaSoft Corporation. ALL RIGHTS RESERVED.