Hey Phil,

It appears you are trying to append the comma to ensure you get the
specific value.  You can simply code it as follows and it will work:

STRSTR($String 1$, $String 2$ +  ",")

...returns 16.

Is there any reason you need to use a wildcard value?  I used a comma
for a similar search and it works great.

CRAIG J. CARTER, RSP

-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of Phil Murnane
Sent: Wednesday, August 22, 2007 9:14 AM
To: [email protected]
Subject: Repost: Wildcard in STRSTR function?

I couldn't find this post on the web server, so I thought I'd r
Folks:

I couldn't find this post on the web server, so I thought I'd repost it.
Any thoughts on this?

Thanks,
--Phil

----- Forwarded Message ----
From: Phil Murnane <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: Phil Murnane <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2007 10:32:23 AM
Subject: Wildcard in STRSTR function?


Folks:

Has anyone ever used a wildcard as the secnd parameter in a STRSTR() 
function?  I'm trying to test whether string2 exists in string1, where 
string2 may be a substring of string3 also in string one.  This is
similar 
to finding a Group ID in a $GROUPIDS$ result.

Example:
ARS 6.3
string1 = ", 20070821-001, 20070821-002, 20070821-002-A, 20070821-003, "
string2 = "20070821-002"
string3 = "20070821-002-A"

I can't just use STRSTR(string1, string2) because even if string1 did
not 
contain string2 this function would erroneously find the value, since 
string2 is a substring of string3.

Here's my syntax:
zScratchInteger = STRSTRC($string1$,(" %, " + $string2$ ) + ", %")

But this always returns -1 -- it never finds string2 in string1.

Is this because of the wildcard percent signs?

TIA,
--Phil


       
________________________________________________________________________
____________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

________________________________________________________________________
_______
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where
the Answers Are"

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

Reply via email to