There's probably a better way, but this works: <cfset lineBreakCount = REfind("[^#chr(13)##chr(10)#]", myString) / 2 />
> -----Original Message----- > From: Hagan, Ryan Mr (Contractor ACI) [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 25, 2003 11:48 AM > To: CF-Talk > Subject: Counting CRLF > > > Hello, > > I'm trying to count the number of CRLF's (Chr(13)&Chr(10)) at the > beginning > of a string, but I can't seem to figure this one out. For > instance, I have > a string that is: > > <cfset lineBreak = Chr(13)&Chr(10)> > <cfset myString = lineBreak & lineBreak & lineBreak & "Hello World."> > > How can I programmatically tell that I've got 3 lineBreaks at the > beginning > of that string? I've been trying to figure this out for the last > 30 minutes > or so and just can't seem to get my head around this seemingly simple > problem. Thanks for the input. > > Ryan Hagan > ph: 540-731-3588 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138506 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4