Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions page (login required).


Determines if a string is alphabetic or not.




string An expression that resolves to a string.


If string consists entirely of alphabetic characters, ALPHA returns 1. Otherwise, ALPHA returns 0. Note that blank spaces are non-alphabetic characters. Dynamic array separator characters are considered to be alphabetic characters. On a Unicode system ALPHA recognizes Unicode letters as alphabetic characters.


The following example uses the ALPHA function to determine if a string consists of only alphabetic characters:

PRINT ALPHA("abcdefg");    ! Returns 1
PRINT ALPHA("AbCdEfG");    ! Returns 1
PRINT ALPHA("my string");  ! Returns 0 (space not allowed)
PRINT ALPHA("half-wit");   ! Returns 0 (hyphen not allowed)
PRINT ALPHA("");           ! Returns 0
PRINT ALPHA(123);          ! Returns 0
Copy code to clipboard

See Also