Discussion:
Last Occurrence?
(too old to reply)
Beverly Howard
2010-05-11 14:32:34 UTC
Permalink
While I can scan a string using a loop to find the last occurrence of a
character or string, wondering if any new functions exist that will find
the last occurrence of a string or character... such as the last <space>
in a sentence.

Beverly Howard
Franck
2010-05-11 14:42:37 UTC
Permalink
Hello,

try RAT() function witch return de start position of the last occurrence of
searched string.

Have a nice day
Post by Beverly Howard
While I can scan a string using a loop to find the last occurrence of a
character or string, wondering if any new functions exist that will find
the last occurrence of a string or character... such as the last <space>
in a sentence.
Beverly Howard
Gene Wirchenko
2010-05-12 02:35:58 UTC
Permalink
Post by Franck
try RAT() function witch return de start position of the last occurrence of
searched string.
Well, this is nice. "gene" is a short form for "general", *and*
I was born in a Chinese Year of the Rat.

Can anyone else "lay claim" to VFP keywords, or am I in a select
group? (But not a "select" group, of course, since there are not
going to be "wirc" areas any time soon.)

[snip]

Sincerely,

Gene Wirchenko
Villi Bernaroli
2010-05-12 06:39:52 UTC
Permalink
Post by Gene Wirchenko
Post by Franck
try RAT() function witch return de start position of the last
occurrence of searched string.
Well, this is nice. "gene" is a short form for "general", *and*
I was born in a Chinese Year of the Rat.
Did you keep into account the differing starting day of the chinese
calendar? I believed I was a Rat till some years ago, when I discovered that
in 1972 the chinese year started after my birthday so I'm in the previous
year, the Wild Boar.
I love polenta with wild boar stew :)
--
Villi Bernaroli, Italy
VFP, SOAP, MS SQLserver, MySQL, Oracle
Gene Wirchenko
2010-05-13 03:09:04 UTC
Permalink
Post by Villi Bernaroli
Post by Gene Wirchenko
Post by Franck
try RAT() function witch return de start position of the last
occurrence of searched string.
Well, this is nice. "gene" is a short form for "general", *and*
I was born in a Chinese Year of the Rat.
Did you keep into account the differing starting day of the chinese
calendar? I believed I was a Rat till some years ago, when I discovered that
in 1972 the chinese year started after my birthday so I'm in the previous
year, the Wild Boar.
Yes, my birthday is in November so I am not affected. Your
birthday must be in January or February.

I have a Chinese friend whose birthday is February 4.
Occasionally, it is chinese New Year's Day. Because the Chinese
calendar is a lunar calendar, some years have twelve months and some
have thirteen. It is possible some Chinese years for her not to have
a birthday or for her to have two. By having a birthday, I mean that
February 4 occurs during a given Chinese year.

And we worry about February 29!
Post by Villi Bernaroli
I love polenta with wild boar stew :)
That reminds me of a Far Side cartoon. One chicken is feeding
chicken soup to an ill chicken. "Quit complaining and eat
it!...number one, chicken soup is good for the flu--and number two,
it's nobody we know." See it at
http://www.angelfire.com/fl/runfromtheduck/farside.html

Foxburgers, anyone?

Sincerely,

Gene Wirchenko
Gregory Adam
2010-05-11 14:44:40 UTC
Permalink
rat()
--
Gregory
_
Post by Beverly Howard
While I can scan a string using a loop to find the last occurrence of a
character or string, wondering if any new functions exist that will find
the last occurrence of a string or character... such as the last <space>
in a sentence.
Beverly Howard
Beverly Howard
2010-05-11 16:36:59 UTC
Permalink
RAT() <<
Ahh... now I remember!

Thanks guys!
Beverly Howard
MikeA
2010-05-14 07:26:19 UTC
Permalink
And of course the third optional parameter allows to search for the nth to
last occurrence in the string rather than the last occurrence.

Mike
Post by Beverly Howard
RAT() <<
Ahh... now I remember!
Thanks guys!
Beverly Howard
Continue reading on narkive:
Loading...