How do I start the 'contains' decision operator in ColdFusion at a specific character in a string? -


my question super simple, can't seem figure out. i'm trying find character 'c' in seemingly random 10 character string. however, care character 'c' if 6th character in string. if character 'c' found @ 6th position in string string should enclosed in dashes (-). example:

14csi14550 should not enclosed in dashes, because c 3rd character in string. 14efec4933 should enclosed in dashes, because c 6th character in string. 14csic5005 should enclosed in dashes though there c in string.

here have far, think i'm on right track contains, think need start looking c @ 5th character in string, skip first 5 characters. wrong though.

code:

<cfif #queryname.tendigitnumber# contains 'c'> <td width="100" class=bodytext valign="top" >-#plan.code#-</td> <cfelse> <td width="100" class=bodytext valign="top" >#plan.code#</td> </cfif> 

this encloses 10 character strings have c in them dashes including 14csi14550, incorrect. appreciated! thanks!

<cfif mid(queryname.tendigitnumber, 6, 1) eq 'c'> .. stuff .. </cfif> 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -