Describe the key AMPscript string and date functions: IIF, FormatDate, DateAdd, Substring, Concat, Replace, UpperCase, Length.
Suggested answer
IIF(condition, trueVal, falseVal) — inline if/else in a single expression.
FormatDate(@date, "shortdate") — formats a date value; supports named patterns (shortdate, longdate) or custom patterns like "MM/DD/YYYY".
DateAdd(@date, numDays, "D") — adds units to a date; unit codes: D (days), M (months), Y (years), H (hours).
Substring(@str, start, length) — extracts characters; 1-based index.
Concat(str1, str2, ...) — concatenates strings.
Replace(@str, "find", "replace") — replaces all occurrences of a substring.
UpperCase(@str) — converts to uppercase; LowerCase and ProperCase also available.
Length(@str) — returns the number of characters in the string.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.