Another option is to use the Mid() function

<cfset temp = Mid(productcode, 1, 4)> 
This grabs the first 4 characters of the varaible produdcode and sets them
to a temporary variable.  You could then, theoretically use that temp
variable in a comparison.

|-----Original Message-----
|From: Hayes, David [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, March 20, 2001 10:58 AM
|To: CF-Talk
|Subject: RE: Read part of a string
|
|
|Look at the list functions (your values can be thought of as lists,
|delimited by "/") as well as the GetToken  function.
|
|-----Original Message-----
|From: Michael Gribbin [mailto:[EMAIL PROTECTED]]
|Sent: Tuesday, March 20, 2001 1:13 AM
|To: CF-Talk
|Subject: Read part of a string
|
|
|Hi, I need to compare the first 4 characters of a product code 
|"BA01/ABC" 
|with the first 4 characters of the next product code in 
|sequence "BA01/DEF"
|to see if they belong to the same group. How do I "read" only 
|those first 4
|characters of each product code?
|
|Thanks in advance,
|
|Michael Gribbin
|Digital Marketing Alliance
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to