[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: SQR instr()



How about using the position of the first M for the offset value?
instr($source,'M',instr($source,'m',0))

?? Didn't try it....

:) Kristin

> -----Original Message-----
> From: Manoj Gurjar [SMTP:mgurjar@HOTMAIL.COM]
> Sent: Friday, November 05, 1999 12:01 PM
> To:   Multiple recipients of list SQR-USERS
> Subject:      SQR instr()
>
> Hi Guys,
>
> I need same functionality as INSTR() function,
> BUT with one more added functionality which can give
> me a position for a sub_value from end of the source_value.
>
> Say for eg: $source = 'Today M is M Friday.'
> I want instr() to give me a position of 'M' just before 'Friday'.
>
> Is there any simple solution. I tried giving negative offset
> thinking it will start searching from end. No luck.
>
> I can achive doing some more coding. Is there any real
> easy solution, which can save me extra coding.
>
>
> FROM MANUAL:
> INSTR
> Returns the numeric position of sub_value in source_value or zero (0) if
> not
> found.  The search begins at offset offset_value.  This function returns a
> float value.
>
> Syntax: dst_var =       instr(source_value, sub_value, offset_value)
>
>
> Thanks in advance,
> Manoj
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com