ToBeReviewed/STRING/
strwhere.pro
return position *array* for occurrence of a character in a string
strwhere
String
result = strwhere(str, schar, count)
Return value
The number of matches that were found
The function returns an index array similar to the
result of the WHERE function
Parameters
str
in
required
the string
schar
in
required
the character to look for
count
Examples
find position of string "a" in the string "abcabcabc"
IDL> ind = strwhere('abcabcabc','a')
IDL> print, ind
[ 0, 3, 6 ]
Version history
Version
$Id: strwhere.pro 378 2008-08-12 12:35:46Z pinsard $
Copyright (C) 1998, Martin Schultz, Harvard University
This software is provided as is without any warranty
whatsoever. It may be freely used, copied or distributed
for non-commercial purposes. This copyright notice must be
kept with any copy of this software. If this software shall
be used commercially or sold as part of a larger package,
please contact the author to arrange payment.
Bugs and comments should be directed to mgs@io.harvard.edu
with subject "IDL routine strwhere"
History
mgs, 02 Jun 1998: VERSION 1.00
bmy, 30 Jun 1998: - now returns COUNT, the number
of matches that are found (this is
analogous to the WHERE command)
Produced by IDLdoc 2.0.