Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/6ce83e51baf869aa3752a8b2bb5a1223 to your computer and use it in GitHub Desktop.
Save trycf/6ce83e51baf869aa3752a8b2bb5a1223 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfoutput>
<cfset var vReturn = "">
<cfset var s = '9781111111111'>
<cfset var i = 0>
<cfloop from="1" to="#len(s)#" index="i">
<cfif listFind("1,5,8,11,14,17", i)>
<cfset vReturn = vReturn & "/">
</cfif>
<cfset vReturn = vReturn & mid(s, i, 1)>
</cfloop>
#vReturn#
<cfset var s = '9781111111111'>
#LEFT(s, 13)#
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment