truncatewords
Truncate a string after arg number of words. Remove newlines within the string.
def truncatewords(
value: string,
arg: integer
) - > string
Truncate a string after arg number of words. Remove newlines within the string.
Parameters
| Name | Type | Description |
|---|---|---|
| value | string | The input text to be truncated. |
| arg | integer | The maximum number of words to retain in the string. |
Returns
| Type | Description |
|---|---|
string | The truncated string followed by an ellipsis if the word count was exceeded, or the original string if the argument is invalid. |