String formats

You can format string values in a manner that you define.

You can use any of the following characters to create a format expression for strings:

Character

Description

@

Character placeholder. Display a character or a space. If the string has a character in the position where the at symbol (@) appears in the format string, display it; otherwise, display a space in that position. Placeholders are filled from right to left unless there is an exclamation point character (!) in the format string.

&

Character placeholder. Display a character or nothing. If the string has a character in the position where the ampersand (&) appears, display it; otherwise, display nothing. Placeholders are filled from right to left unless there is an exclamation point character (!) in the format string.

<

Force lowercase. Display all characters in lowercase format.

>

Force uppercase. Display all characters in uppercase format.

!

Force left to right fill of placeholders. The default is to fill placeholders from right to left.

A format expression for strings can have one section or two sections separated by a semicolon (;).

If you use

The result is

One section only

The format applies to all string data.

Two sections

The first section applies to string data,
and the second section applies to Null values and zero-length strings ("").

 

More:

String format examples