Chapter Contents |
Previous |
Next |
INDEXW |
Category: | Character |
Syntax | |
Arguments | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
INDEXW(source, excerpt) |
Details |
The INDEXW function searches source, from left to right, for the first occurrence of excerpt and returns the position in source of the substring's first character. If the substring is not found in source, INDEXW returns a value of 0. If there are multiple occurrences of the string, INDEXW returns only the position of the first occurrence.
The substring pattern must begin and end on a word boundary. For INDEXW, word boundaries are blanks, the beginning of source, and the end of source. Punctuation marks are not word boundaries.
Comparisons |
Examples |
SAS Statements | Results |
---|---|
s='asdf adog dog'; p='dog '; x=indexw(s,p); put x; |
11 |
s='abcdef x=y'; p='def'; x=indexw(s,p); put x; |
0 |
See Also |
Functions:
|
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.