Hi Everyone.
I need to find the last occurance of a character in a string. Is there
a way I can use a regular expression to search the string from the end
backwards for the character? Or is there another way I can do it using
a CF function. At the moment I have a conditional loop that uses the
reverse the string, find the character, length of the string minus the
pos of the character.
Adam
On Wed, 12 Jan 2005 11:39:24 +, Andrew Dixon [EMAIL PROTECTED] wrote:
Hi Everyone.
I need to find the last occurance of a character in a string. Is there
a way I can use a regular
Alernatively you can use refind and return the array thing I beleive
it returns the POS and Len of all the times it found then you could
just look at the last element in the array, TIMTOWTDI.
Adam H
On Wed, 12 Jan 2005 11:39:24 +, Andrew Dixon [EMAIL PROTECTED] wrote:
Hi Everyone.
I
Nope. The array thing still only gives the first occurance.
Andrew.
~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message:
previous post. Reverse the string and look for the
first occurrence.
-Original Message-
From: Adam Haskell [mailto:[EMAIL PROTECTED]
Sent: 12 January 2005 13:16
To: CF-Talk
Subject: Re: Regular Expression (searching from the end)
Alernatively you can use refind and return the array thing
Thank you very much Pascal. Worked like a dream.
Andrew.
~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message:
Andrew Dixon wrote:
I need to find the last occurance of a character in a string.
REFindNoCase(.*character, string, TRUE) will give you a
position and a length. Position will always be 1, length will
tell you the last occurance.
Jochem
7 matches
Mail list logo