truncate


Description:

public static string truncate (string? s, int maxLen, string ellipsis)

Truncate the string to the specified maximum length, appending ellipsis if truncated.

Example:

    assert (Strings.truncate ("Hello World", 8, "...") == "Hello...");

Parameters:

s

the string.

maxLen

maximum length of result including ellipsis.

ellipsis

the ellipsis string to append.

Returns:

truncated string.