Whoohoo.

Dan Haley
Creator of Readable Code



-----Original Message-----
From: Chris Lofback [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 1:16 PM
To: CF-Talk
Subject: RE: Number of times a character is in a string


Yes, I threw it together too quickly.  But Dan Haley nailed it.  :)

Chris Lofback
Sr. Web Developer

TRX Integration
28051 US 19 N., Ste. C
Clearwater, FL  33761
www.trxi.com


> -----Original Message-----
> From: Raymond Camden [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 30, 2002 4:18 PM
> To: CF-Talk
> Subject: RE: Number of times a character is in a string
> 
> 
> Good catch there. Although you get points off for using evaluate - I'd
> use a temp variable just to make it more readable. ;)
> 
> ==============================================================
> =========
> Raymond Camden, ColdFusion Jedi Master for Macromedia
> 
> Email    : [EMAIL PROTECTED]
> Yahoo IM : morpheus
> 
> "My ally is the Force, and a powerful ally it is." - Yoda 
> 
> > -----Original Message-----
> > From: Chris Lofback [mailto:[EMAIL PROTECTED]] 
> > Sent: Tuesday, July 30, 2002 4:05 PM
> > To: CF-Talk
> > Subject: RE: Number of times a character is in a string
> > 
> > 
> > Using ListLen won't work for single characters or for longer 
> > strings that
> > contain only the target character.  Here's one way to do it 
> for single
> > characters, case-sensitive:
> > 
> > <CFSET MyString = "aa">
> > 
> > Character &quot;a&quot; occurs <CFOUTPUT>#Evaluate(Len(MyString) -
> > Len(Replace(MyString,"a","","ALL")))#</CFOUTPUT> times
> > 
> > 
> > > -----Original Message-----
> > > From: Shawn Kernes [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 30, 2002 3:51 PM
> > > To: CF-Talk
> > > Subject: RE: Number of times a character is in a string
> > > 
> > > 
> > > ListLen(list [, delimiters ]) - 1
> > > 
> > > where the delimiter is the char you are looking for
> > > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: Graham Pearson [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, July 30, 2002 12:44 PM
> > > To: CF-Talk
> > > Subject: Number of times a character is in a string
> > > 
> > > 
> > > Anyway to find out the total number of times a character is 
> > apart of a
> > > specific string. Any direction greatly appreciated.
> > > 
> > > 
> > > 
> > > --------------------------------------------------------------
> > > --------------
> > > ---------------
> > > Graham Pearson, System Administrator / Certified Webmaster
> > > Northern Indiana Educational Services Center
> > > Http://support.niesc.k12.in.us  Email: 
> > > [EMAIL PROTECTED]
> > > 
> > > Voice (574) 254-0444 Ext 108 / (800) 326-5642 Fax: (574) 254-0148
> > > --------------------------------------------------------------
> > > --------------
> > > ----------------
> > > 
> > > 
> > > 
> > 
> 

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to