octave: Character Class Functions

 
 5.7 Character Class Functions
 =============================
 
 Octave also provides the following character class test functions
 patterned after the functions in the standard C library.  They all
 operate on string arrays and return matrices of zeros and ones.
 Elements that are nonzero indicate that the condition was true for the
 corresponding character in the string array.  For example:
 
      isalpha ("!Q@WERT^Y&")
           ⇒ [ 0, 1, 0, 1, 1, 1, 1, 0, 1, 0 ]
 
  -- : isalnum (S)
      Return a logical array which is true where the elements of S are
      letters or digits and false where they are not.
 
      This is equivalent to (‘isalpha (S) | isdigit (S)’).
 
      See also: Seeisalpha XREFisalpha, Seeisdigit XREFisdigit,
DONTPRINTYET       Seeispunct XREFispunct, Seeisspace XREFisspace, *noteDONTPRINTYET       Seeispunct XREFispunct, Seeisspace XREFisspace, See
      iscntrl XREFiscntrl.
 
  -- : isalpha (S)
      Return a logical array which is true where the elements of S are
      letters and false where they are not.
 
      This is equivalent to (‘islower (S) | isupper (S)’).
 
      See also: Seeisdigit XREFisdigit, Seeispunct XREFispunct,
DONTPRINTYET       Seeisspace XREFisspace, Seeiscntrl XREFiscntrl, *noteDONTPRINTYET DONTPRINTYET       Seeisspace XREFisspace, Seeiscntrl XREFiscntrl, See
      isalnum XREFisalnum, Seeislower XREFislower, *noteisupper:
DONTPRINTYET DONTPRINTYET       Seeisspace XREFisspace, Seeiscntrl XREFiscntrl, See
      isalnum XREFisalnum, Seeislower XREFislower, Seeisupper

      XREFisupper.
 
  -- : isletter (S)
      Return a logical array which is true where the elements of S are
      letters and false where they are not.
 
      This is an alias for the ‘isalpha’ function.
 
      See also: Seeisalpha XREFisalpha, Seeisdigit XREFisdigit,
DONTPRINTYET       Seeispunct XREFispunct, Seeisspace XREFisspace, *noteDONTPRINTYET       Seeispunct XREFispunct, Seeisspace XREFisspace, See
      iscntrl XREFiscntrl, Seeisalnum XREFisalnum.
 
  -- : islower (S)
      Return a logical array which is true where the elements of S are
      lowercase letters and false where they are not.
 
      See also: Seeisupper XREFisupper, Seeisalpha XREFisalpha,
      Seeisletter XREFisletter, Seeisalnum XREFisalnum.
 
  -- : isupper (S)
      Return a logical array which is true where the elements of S are
      uppercase letters and false where they are not.
 
      See also: Seeislower XREFislower, Seeisalpha XREFisalpha,
      Seeisletter XREFisletter, Seeisalnum XREFisalnum.
 
  -- : isdigit (S)
      Return a logical array which is true where the elements of S are
      decimal digits (0-9) and false where they are not.
 
      See also: Seeisxdigit XREFisxdigit, Seeisalpha XREFisalpha,
DONTPRINTYET       Seeisletter XREFisletter, Seeispunct XREFispunct, *noteDONTPRINTYET       Seeisletter XREFisletter, Seeispunct XREFispunct, See
      isspace XREFisspace, Seeiscntrl XREFiscntrl.
 
  -- : isxdigit (S)
      Return a logical array which is true where the elements of S are
      hexadecimal digits (0-9 and a-fA-F).
 
      See also: Seeisdigit XREFisdigit.
 
  -- : ispunct (S)
      Return a logical array which is true where the elements of S are
      punctuation characters and false where they are not.
 
      See also: Seeisalpha XREFisalpha, Seeisdigit XREFisdigit,
      Seeisspace XREFisspace, Seeiscntrl XREFiscntrl.
 
  -- : isspace (S)
      Return a logical array which is true where the elements of S are
      whitespace characters (space, formfeed, newline, carriage return,
      tab, and vertical tab) and false where they are not.
 
      See also: Seeiscntrl XREFiscntrl, Seeispunct XREFispunct,
      Seeisalpha XREFisalpha, Seeisdigit XREFisdigit.
 
  -- : iscntrl (S)
      Return a logical array which is true where the elements of S are
      control characters and false where they are not.
 
      See also: Seeispunct XREFispunct, Seeisspace XREFisspace,
      Seeisalpha XREFisalpha, Seeisdigit XREFisdigit.
 
  -- : isgraph (S)
      Return a logical array which is true where the elements of S are
      printable characters (but not the space character) and false where
      they are not.
 
      See also: Seeisprint XREFisprint.
 
  -- : isprint (S)
      Return a logical array which is true where the elements of S are
      printable characters (including the space character) and false
      where they are not.
 
      See also: Seeisgraph XREFisgraph.
 
  -- : isascii (S)
      Return a logical array which is true where the elements of S are
      ASCII characters (in the range 0 to 127 decimal) and false where
      they are not.
 
  -- : isstrprop (STR, PROP)
      Test character string properties.
 
      For example:
 
           isstrprop ("abc123", "alpha")
           ⇒ [1, 1, 1, 0, 0, 0]
 
      If STR is a cell array, ‘isstrpop’ is applied recursively to each
      element of the cell array.
 
      Numeric arrays are converted to character strings.
 
      The second argument PROP must be one of
 
      "alpha"
           True for characters that are alphabetic (letters).
 
      "alnum"
      "alphanum"
           True for characters that are alphabetic or digits.
 
      "lower"
           True for lowercase letters.
 
      "upper"
           True for uppercase letters.
 
      "digit"
           True for decimal digits (0-9).
 
      "xdigit"
           True for hexadecimal digits (a-fA-F0-9).
 
      "space"
      "wspace"
           True for whitespace characters (space, formfeed, newline,
           carriage return, tab, vertical tab).
 
      "punct"
           True for punctuation characters (printing characters except
           space or letter or digit).
 
      "cntrl"
           True for control characters.
 
      "graph"
      "graphic"
           True for printing characters except space.
 
      "print"
           True for printing characters including space.
 
      "ascii"
           True for characters that are in the range of ASCII encoding.
 
      See also: Seeisalpha XREFisalpha, Seeisalnum XREFisalnum,
DONTPRINTYET       Seeislower XREFislower, Seeisupper XREFisupper, *noteDONTPRINTYET DONTPRINTYET       Seeislower XREFislower, Seeisupper XREFisupper, See
      isdigit XREFisdigit, Seeisxdigit XREFisxdigit, *noteisspace:
DONTPRINTYET DONTPRINTYET DONTPRINTYET       Seeislower XREFislower, Seeisupper XREFisupper, See
      isdigit XREFisdigit, Seeisxdigit XREFisxdigit, Seeisspace

      XREFisspace, Seeispunct XREFispunct, *noteiscntrl:
DONTPRINTYET DONTPRINTYET DONTPRINTYET DONTPRINTYET       Seeislower XREFislower, Seeisupper XREFisupper, See
      isdigit XREFisdigit, Seeisxdigit XREFisxdigit, Seeisspace

      XREFisspace, Seeispunct XREFispunct, Seeiscntrl

      XREFiscntrl, Seeisgraph XREFisgraph, *noteisprint:
DONTPRINTYET DONTPRINTYET DONTPRINTYET DONTPRINTYET       Seeislower XREFislower, Seeisupper XREFisupper, See
      isdigit XREFisdigit, Seeisxdigit XREFisxdigit, Seeisspace

      XREFisspace, Seeispunct XREFispunct, Seeiscntrl

      XREFiscntrl, Seeisgraph XREFisgraph, Seeisprint

      XREFisprint, Seeisascii XREFisascii.