fn:startsWith
    • 1 Minute to read
    • Dark
      Light

    fn:startsWith

    • Dark
      Light

    Article summary

    The function fn:startsWith determines whether a target string starts with the specified substring. The value returned is a Boolean data type.

    Example

    A special message is sent to recipients within a specific postal code. The function searches the target attribute ​user['ZipCode']​ for the value ​'SW'​. The line of text is inserted into the message with an ​InsertIf​ statement, which is constructed as follows:

    <%InsertIf expression="${fn:startsWith(user['ZipCode'], 'SW')}"%>Text<%/InsertIf%>

    Structure​

    fn:startsWith(string, string)

    Parameters​

    Parameter

    Description

    string

    Specifies the target string.

    string

    The value (prefix) used to query the target.


    Was this article helpful?

    What's Next