twaddle

Abbreviations

The abbreviate or abbr function creates an abbreviation from the words of the following block. Below is a simple example input and the corresponding output.

>[abbr]{Hello, internet}!
HI!

Abbreviation algorithm

The abbreviation is created by splitting the block at whitespace, and taking the first alphabetic character or string of one-or-more numeric digits from each component. Any components which do not include an alphabetic character or string of digits do not contribute to the abbreviation.

Some illustrative examples:

>[abbr]{Every 24 Hours}
E24H
>[abbr]{$ABC ???4}
A4
>[abbr]{$ABC ??? Hi}
AH
>[abbr]{Hello\nInternet}
HI

Arguments

The function does not require any arguments. One optional argument is permitted:

[abbr:<case>]

The case argument, if provided, must have one of the following values:

If no argument is provided ([abbr]), the default value is upper.

Providing any other value, including the empty string, results in a TwaddleFunctionException being raised.