how can i count number of characters in string with coldfusion ?

hi,

i want to count the number of characters in string (access database) with coldfusion. any solution ?

thanks
represente03Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SViewCommented:
Try this

ListLen(string, "/"), this will split the string on each /  you will then need to -1 from the count of the result and this should  give you the /
 
 <cfset slashCount =  ListLen(string, "/") - 1>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
represente03Author Commented:
sview it's not a word that i want to find but the number of all characters in string.

HyperBPP the function len() is a good solution i have test it but how can i count the number of characters of several string ?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

represente03Author Commented:
how can i addition these several characters in a <cfoutput query> ?
0
HyperBPPCommented:
len(variable1 & variable2 & variable3 & etc)

<cfset temp = ""/>
<cfoutput query="name">
     <cfset temp = temp & queryField/>
</cfoutput>
<cfoutput>len(temp)</cfoutput>
0
represente03Author Commented:
ok thanks and last thing please, how can i say that:  after 200 characters, "do this" ?
0
_agx_Commented:
> but how can i count the number of characters of several string ?

It depends. In some cases it makes more sense to do the counting in CF, while in others you'd use a db function. For example, if you wanted to get the maximum length of all values in a column named "LastName", you'd use the db functions. The function names are db dependent: MS SQL it is LEN(), MySQL it's LENGTH(), etc....

SELECT  MAX(LEN(LastName)) AS MaxLength FROM SomeTable

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.