Skip to main content

MIDDLE INITIAL

This PSLang expression, also used for the value of target attributes (e.g., initials on Active Directory), contains more than one statement:

var $other = iif( size($OTHER_NAME) > 0, $OTHER_NAME[0], "" );
$other[0];

This retrieves the first character of a user’s “other name”. The $OTHER_NAME variable is an array of strings. Like other profile attributes it could be defined to accept more than one value. So, the expression assigns the first element of $OTHER_NAME (assuming it exists, otherwise it returns a blank string) to $other. Since the variable $other is just a string, and not an array, the expression $other[0] gets just the first character of the “other name”.