Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b38d2da330d1936e5ab1307c039c4941 > files > 153

octave-doc-3.6.4-3.mga4.noarch.rpm

<html lang="en">
<head>
<title>Character Class Functions - GNU Octave</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Octave">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Strings.html#Strings" title="Strings">
<link rel="prev" href="String-Conversions.html#String-Conversions" title="String Conversions">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Character-Class-Functions"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="String-Conversions.html#String-Conversions">String Conversions</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Strings.html#Strings">Strings</a>
<hr>
</div>

<h3 class="section">5.7 Character Class Functions</h3>

<p>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:

<pre class="example">     isalpha ("!Q@WERT^Y&amp;")
          &rArr; [ 0, 1, 0, 1, 1, 1, 1, 0, 1, 0 ]
</pre>
   <!-- isalnum src/mappers.cc -->
   <p><a name="doc_002disalnum"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isalnum</b> (<var>s</var>)<var><a name="index-isalnum-417"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
letters or digits and false where they are not.  This is equivalent to
(<code>isalpha (</code><var>s</var><code>) | isdigit (</code><var>s</var><code>)</code>). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>, <a href="doc_002dispunct.html#doc_002dispunct">ispunct</a>, <a href="doc_002disspace.html#doc_002disspace">isspace</a>, <a href="doc_002discntrl.html#doc_002discntrl">iscntrl</a>. 
</p></blockquote></div>

<!-- isalpha src/mappers.cc -->
   <p><a name="doc_002disalpha"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isalpha</b> (<var>s</var>)<var><a name="index-isalpha-418"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
letters and false where they are not.  This is equivalent to
(<code>islower (</code><var>s</var><code>) | isupper (</code><var>s</var><code>)</code>). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>, <a href="doc_002dispunct.html#doc_002dispunct">ispunct</a>, <a href="doc_002disspace.html#doc_002disspace">isspace</a>, <a href="doc_002discntrl.html#doc_002discntrl">iscntrl</a>, <a href="doc_002disalnum.html#doc_002disalnum">isalnum</a>, <a href="doc_002dislower.html#doc_002dislower">islower</a>, <a href="doc_002disupper.html#doc_002disupper">isupper</a>. 
</p></blockquote></div>

<!-- isletter scripts/strings/isletter.m -->
   <p><a name="doc_002disletter"></a>

<div class="defun">
&mdash; Function File:  <b>isletter</b> (<var>s</var>)<var><a name="index-isletter-419"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var>
are letters and false where they are not.  This is an alias for
the <code>isalpha</code> function. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>, <a href="doc_002dispunct.html#doc_002dispunct">ispunct</a>, <a href="doc_002disspace.html#doc_002disspace">isspace</a>, <a href="doc_002discntrl.html#doc_002discntrl">iscntrl</a>, <a href="doc_002disalnum.html#doc_002disalnum">isalnum</a>. 
</p></blockquote></div>

<!-- islower src/mappers.cc -->
   <p><a name="doc_002dislower"></a>

<div class="defun">
&mdash; Mapping Function:  <b>islower</b> (<var>s</var>)<var><a name="index-islower-420"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
lowercase letters and false where they are not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disupper.html#doc_002disupper">isupper</a>, <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disletter.html#doc_002disletter">isletter</a>, <a href="doc_002disalnum.html#doc_002disalnum">isalnum</a>. 
</p></blockquote></div>

<!-- isupper src/mappers.cc -->
   <p><a name="doc_002disupper"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isupper</b> (<var>s</var>)<var><a name="index-isupper-421"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
uppercase letters and false where they are not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dislower.html#doc_002dislower">islower</a>, <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disletter.html#doc_002disletter">isletter</a>, <a href="doc_002disalnum.html#doc_002disalnum">isalnum</a>. 
</p></blockquote></div>

<!-- isdigit src/mappers.cc -->
   <p><a name="doc_002disdigit"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isdigit</b> (<var>s</var>)<var><a name="index-isdigit-422"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
decimal digits (0-9) and false where they are not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disxdigit.html#doc_002disxdigit">isxdigit</a>, <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disletter.html#doc_002disletter">isletter</a>, <a href="doc_002dispunct.html#doc_002dispunct">ispunct</a>, <a href="doc_002disspace.html#doc_002disspace">isspace</a>, <a href="doc_002discntrl.html#doc_002discntrl">iscntrl</a>. 
</p></blockquote></div>

<!-- isxdigit src/mappers.cc -->
   <p><a name="doc_002disxdigit"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isxdigit</b> (<var>s</var>)<var><a name="index-isxdigit-423"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
hexadecimal digits (0-9 and a-fA-F). 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>. 
</p></blockquote></div>

<!-- ispunct src/mappers.cc -->
   <p><a name="doc_002dispunct"></a>

<div class="defun">
&mdash; Mapping Function:  <b>ispunct</b> (<var>s</var>)<var><a name="index-ispunct-424"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
punctuation characters and false where they are not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>, <a href="doc_002disspace.html#doc_002disspace">isspace</a>, <a href="doc_002discntrl.html#doc_002discntrl">iscntrl</a>. 
</p></blockquote></div>

<!-- isspace src/mappers.cc -->
   <p><a name="doc_002disspace"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isspace</b> (<var>s</var>)<var><a name="index-isspace-425"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
whitespace characters (space, formfeed, newline, carriage return, tab, and
vertical tab) and false where they are not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002discntrl.html#doc_002discntrl">iscntrl</a>, <a href="doc_002dispunct.html#doc_002dispunct">ispunct</a>, <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>. 
</p></blockquote></div>

<!-- iscntrl src/mappers.cc -->
   <p><a name="doc_002discntrl"></a>

<div class="defun">
&mdash; Mapping Function:  <b>iscntrl</b> (<var>s</var>)<var><a name="index-iscntrl-426"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
control characters and false where they are not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dispunct.html#doc_002dispunct">ispunct</a>, <a href="doc_002disspace.html#doc_002disspace">isspace</a>, <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>. 
</p></blockquote></div>

<!-- isgraph src/mappers.cc -->
   <p><a name="doc_002disgraph"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isgraph</b> (<var>s</var>)<var><a name="index-isgraph-427"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
printable characters (but not the space character) and false where they are
not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disprint.html#doc_002disprint">isprint</a>. 
</p></blockquote></div>

<!-- isprint src/mappers.cc -->
   <p><a name="doc_002disprint"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isprint</b> (<var>s</var>)<var><a name="index-isprint-428"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
printable characters (including the space character) and false where they
are not. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002disgraph.html#doc_002disgraph">isgraph</a>. 
</p></blockquote></div>

<!-- isascii src/mappers.cc -->
   <p><a name="doc_002disascii"></a>

<div class="defun">
&mdash; Mapping Function:  <b>isascii</b> (<var>s</var>)<var><a name="index-isascii-429"></a></var><br>
<blockquote><p>Return a logical array which is true where the elements of <var>s</var> are
ASCII characters (in the range 0 to 127 decimal) and false where they are
not. 
</p></blockquote></div>

<!-- isstrprop scripts/strings/isstrprop.m -->
   <p><a name="doc_002disstrprop"></a>

<div class="defun">
&mdash; Function File:  <b>isstrprop</b> (<var>str, prop</var>)<var><a name="index-isstrprop-430"></a></var><br>
<blockquote><p>Test character string properties.  For example:

     <pre class="example">          isstrprop ("abc123", "alpha")
          &rArr; [1, 1, 1, 0, 0, 0]
</pre>
        <p>If <var>str</var> is a cell array, <code>isstrpop</code> is applied recursively
to each element of the cell array.

        <p>Numeric arrays are converted to character strings.

        <p>The second argument <var>prop</var> must be one of

          <dl>
<dt>"alpha"<dd>True for characters that are alphabetic (letters).

          <br><dt>"alnum"<dt>"alphanum"<dd>True for characters that are alphabetic or digits.

          <br><dt>"lower"<dd>True for lowercase letters.

          <br><dt>"upper"<dd>True for uppercase letters.

          <br><dt>"digit"<dd>True for decimal digits (0-9).

          <br><dt>"xdigit"<dd>True for hexadecimal digits (a-fA-F0-9).

          <br><dt>"space"<dt>"wspace"<dd>True for whitespace characters (space, formfeed, newline, carriage
return, tab, vertical tab).

          <br><dt>"punct"<dd>True for punctuation characters (printing characters except space
or letter or digit).

          <br><dt>"cntrl"<dd>True for control characters.

          <br><dt>"graph"<dt>"graphic"<dd>True for printing characters except space.

          <br><dt>"print"<dd>True for printing characters including space.

          <br><dt>"ascii"<dd>True for characters that are in the range of ASCII encoding.

        </dl>

     <!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
     <!-- A simple blank line produces the correct behavior. -->
     <!-- @sp 1 -->
     <p class="noindent"><strong>See also:</strong> <a href="doc_002disalpha.html#doc_002disalpha">isalpha</a>, <a href="doc_002disalnum.html#doc_002disalnum">isalnum</a>, <a href="doc_002dislower.html#doc_002dislower">islower</a>, <a href="doc_002disupper.html#doc_002disupper">isupper</a>, <a href="doc_002disdigit.html#doc_002disdigit">isdigit</a>, <a href="doc_002disxdigit.html#doc_002disxdigit">isxdigit</a>, <a href="doc_002disspace.html#doc_002disspace">isspace</a>, <a href="doc_002dispunct.html#doc_002dispunct">ispunct</a>, <a href="doc_002discntrl.html#doc_002discntrl">iscntrl</a>, <a href="doc_002disgraph.html#doc_002disgraph">isgraph</a>, <a href="doc_002disprint.html#doc_002disprint">isprint</a>, <a href="doc_002disascii.html#doc_002disascii">isascii</a>. 
</p></blockquote></div>

<!-- DO NOT EDIT!  Generated automatically by munge-texi.pl. -->
<!-- Copyright (C) 1996-2012 John W. Eaton -->
<!-- This file is part of Octave. -->
<!-- Octave is free software; you can redistribute it and/or modify it -->
<!-- under the terms of the GNU General Public License as published by the -->
<!-- Free Software Foundation; either version 3 of the License, or (at -->
<!-- your option) any later version. -->
<!-- Octave is distributed in the hope that it will be useful, but WITHOUT -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License -->
<!-- for more details. -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with Octave; see the file COPYING.  If not, see -->
<!-- <http://www.gnu.org/licenses/>. -->
   </body></html>