0

I'm looking for a way to limit the number of characters for a dynamic box so if there are more than let's say 300, the text will end with ...

Can this be done through AMPscript?

Thanks for your input! VD

2

You're probably looking for the Substring() function:

%%[
var @str1, @str2
set @str1 = "1234567890"
set @str2 = iif(length(@str1) > 5, concat(substring(@str1,1,5),"..."), @str1)
]%%
@str2: %%=v(@str2)=%%

Output:

@str2: 12345...
1
  • never heard of Length but it seems it's what I need. Thanks Adam! – Snowalker Jan 8 '16 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.