gwp_substring
With the gwp_substring Modifier for Gravity Forms Merge Tags it’s possible to return a part of value (a substring of the original string). You can use the modifier like this:
:gwp_substring start= length=
The modifier has two arguments:
- start: how many characters should it skip when using a positive value / where does the substring start. When using a negative value (for example -3), the substring will start the number of characters before the end of the value.
- length: how many characters should be in the substring / what is the length of the substring.
Example gwp_substring
This example gives back a substring of the value in the Gravity Forms field ‘String’ (with Field ID 1). It skips the first two characters and gives back 3 characters:
{String:1:gwp_substring start=2 length=3}
Offset from the end of the string
When using a negative value for the start of the substring (for example start=-3), the substring will start 3 characters before the end of the value (string).
{String:1:gwp_substring start=-3 length=1}