Developer Resources for AbleCommerce eCommerce platform
CommerceBuilder.Utility Namespace / StringHelper Class / Truncate Method
The string to keep within the specified limit.
The maximum length of the string.
In This Topic
    Truncate Method
    In This Topic
    Limits an input string to the specified length.
    Syntax
    public static string Truncate( 
       string input,
       int maxLength
    )

    Parameters

    input
    The string to keep within the specified limit.
    maxLength
    The maximum length of the string.

    Return Value

    If the input string is less than or equal to the maxLength, the original string is returned. If the input string is greater than maxLength, the string is truncated to the correct length.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also