Macro for string length

Daikoku

Client
Регистрация
23.03.2011
Сообщения
16
Благодарностей
2
Баллы
0
A macro for getting the length of an input string would be great. sometimes input strings are too long in some of my projects and have to be shortened. therefore there should be a macro which returns the string lenth.
 

step85

Client
Регистрация
19.02.2010
Сообщения
1 839
Благодарностей
287
Баллы
83
To cut the excess string - Run it through a regular expression. {10} where 10 - is the number of necessary symbols
 

Daikoku

Client
Регистрация
23.03.2011
Сообщения
16
Благодарностей
2
Баллы
0
That works fine but I still need a way to get the length of a string. I need that for some logic operations.
 

BlackSun

Client
Регистрация
24.01.2011
Сообщения
119
Благодарностей
3
Баллы
0
That works fine but I still need a way to get the length of a string. I need that for some logic operations.
Yes, finding the length of a string is very useful. It is possible to get it with a small piece of javascript but a macro for this would be great.

Here's how to do with a piece of javascript

Код:
{-JS.Execute-|-var length='{-FieldData.FieldData-|-step-|-branch-}'.length;-}
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)