abbreviate name

Prev Next

Function Names

abbreviate name

Library

Utility Library

Description

This function abbreviates names. The abbreviation contains the first letters of the first, all middle and last names. Multiple letters will be included for following sequences:
Ch, Gh, Ll, Ph, Rh, Sch, Sh, Sp, St, Th, Zh

Call as: function

Restrictions

Under normal conditions, the 'Utility Library' is loaded automatically, so no 'include(...)' call is needed.

Parameter count

1

Parameters

No.TypeDescription
1.
input
string Name to abbreviate

Return value

TypeDescription
string Abbreviation

Examples

       echo( abbreviate name( "John Adams" ) );      
       echo( abbreviate name( "John F. Kennedy" ) );
       echo( abbreviate name( "Ludwig van Beethoven" ) );
       echo( abbreviate name( "Sherlock Holmes" ) );

Output

JA
JFK
LvB
ShH
Try it yourself: Open LIB_Function_abbreviate_name.b4p in B4P_Examples.zip. Decompress before use.