Clicky

I have a variable named CoupNumber that contains the following data:
43,myMobi Saver test's',test,Cleveland,12-22-11

How do I delete everything starting with the first coma so I only have 43?

I'm using Coldfusion 9 if thats any help?

asked 12/14/2011 06:05

sonicimpulse's gravatar image

sonicimpulse ♦♦


1 Answers:

This will take the first element of the comma delimited string giving you just 43.  If nothing is before the first comma this will give an empty string
<cfset theValue = listFirst(theString)>

This will take the first number, up until a non-number (the comma) giving you 43.  If no number is found, this will give 0
<cfset theValue = val(theString)>
link

answered

gdemaria's gravatar image

gdemaria

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×4
×32
×15

Asked: 12/14/2011 06:05

Seen: 406 times

Last updated: 12/14/2011 06:32