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

1 Answer 1

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
    Commented Jan 8, 2016 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .