How to get a space counter before the beginning of a line

How do you get the number of spaces before the start of a line in ColdFusion?

I mean, I have a line like this "Hello World!"

I want to get the number of spaces (in this case 3) before the word "Hello" begins.

+5
source share
1 answer

I'm not very familiar with ColdFusion, but by looking at this API you can get the result you need:

Len(str) - Len(LTrim(str))

But maybe there is a better solution :)

+12
source

All Articles