Navigation

Operators and Keywords

Function List:

C++ API

strfns.cc File Reference

#include <cctype>
#include <queue>
#include <sstream>
#include "dMatrix.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "gripes.h"
#include "ov.h"
#include "oct-obj.h"
#include "unwind-prot.h"
#include "utils.h"

Include dependency graph for strfns.cc:


Functions

 DEFUN (char, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} char (@var{x})\n\ @deftypefnx {Built-in Function} {} char (@var{x}, @dots{})\n\ @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{})\n\ @deftypefnx {Built-in Function} {} char (@var{cell_array})\n\ Create a string array from one or more numeric matrices, character\n\ matrices, or cell arrays. Arguments are concatenated vertically.\n\ The returned values are padded with blanks as needed to make each row\n\ of the string array have the same length. Empty input strings are\n\ significant and will concatenated in the output.\n\ \n\ For numerical input, each element is converted\n\ to the corresponding ASCII character. A range error results if an input\n\ is outside the ASCII range (0-255).\n\ \n\ For cell arrays, each element is concatenated separately. Cell arrays converted through\n\ @code{char} can mostly be converted back with @code{cellstr}.\n\ For example,\n\ \n\ @example\n\ @group\n\ char ([97, 98, 99], \"\", @{\"98\", \"99\", 100@}, \"str1\", [\"ha\", \"lf\"])\n\ @result{} [\"abc \"\n\ \" \"\n\ \"98 \"\n\ \"99 \"\n\ \"d \"\n\ \"str1 \"\n\ \"half \"]\n\ @end group\n\ @end example\n\ @seealso{strvcat, cellstr}\n\ @end deftypefn")
 DEFUN (strvcat, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strvcat (@var{x})\n\ @deftypefnx {Built-in Function} {} strvcat (@var{x}, @dots{})\n\ @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{})\n\ @deftypefnx {Built-in Function} {} strvcat (@var{cell_array})\n\ Create a character array from one or more numeric matrices, character\n\ matrices, or cell arrays. Arguments are concatenated vertically.\n\ The returned values are padded with blanks as needed to make each row\n\ of the string array have the same length. Unlike @code{char}, empty\n\ strings are removed and will not appear in the output.\n\ \n\ For numerical input, each element is converted\n\ to the corresponding ASCII character. A range error results if an input\n\ is outside the ASCII range (0-255).\n\ \n\ For cell arrays, each element is concatenated separately. Cell arrays converted through\n\ @code{strvcat} can mostly be converted back with @code{cellstr}.\n\ For example,\n\ \n\ @example\n\ @group\n\ strvcat ([97, 98, 99], \"\", @{\"98\", \"99\", 100@}, \"str1\", [\"ha\", \"lf\"])\n\ @result{} [\"abc \"\n\ \"98 \"\n\ \"99 \"\n\ \"d \"\n\ \"str1 \"\n\ \"half \"]\n\ @end group\n\ @end example\n\ @seealso{char, strcat, cstrcat}\n\ @end deftypefn")
 DEFUN (ischar, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ischar (@var{a})\n\ Return 1 if @var{a} is a character array. Otherwise, return 0.\n\ @end deftypefn")
 DEFUN (strcmp, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strcmp (@var{s1}, @var{s2})\n\ Return 1 if the character strings @var{s1} and @var{s2} are the same,\n\ and 0 otherwise.\n\ \n\ If either @var{s1} or @var{s2} is a cell array of strings, then an array\n\ of the same size is returned, containing the values described above for\n\ every member of the cell array. The other argument may also be a cell\n\ array of strings (of the same size or with only one element), char matrix\n\ or character string.\n\ \n\ @strong{Caution:} For compatibility with @sc{matlab}, Octave's strcmp\n\ function returns 1 if the character strings are equal, and 0 otherwise.\n\ This is just the opposite of the corresponding C library function.\n\ @seealso{strcmpi, strncmp, strncmpi}\n\ @end deftypefn")
 DEFUN (strncmp, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strncmp (@var{s1}, @var{s2}, @var{n})\n\ Return 1 if the first @var{n} characters of strings @var{s1} and @var{s2} are the same,\n\ and 0 otherwise.\n\ \n\ @example\n\ @group\n\ strncmp (\"abce\", \"abcd\", 3)\n\ @result{} 1\n\ @end group\n\ @end example\n\ \n\ If either @var{s1} or @var{s2} is a cell array of strings, then an array\n\ of the same size is returned, containing the values described above for\n\ every member of the cell array. The other argument may also be a cell\n\ array of strings (of the same size or with only one element), char matrix\n\ or character string.\n\ \n\ @example\n\ @group\n\ strncmp (\"abce\", @{\"abcd\", \"bca\", \"abc\"@}, 3)\n\ @result{} [1, 0, 1]\n\ @end group\n\ @end example\n\ \n\ @strong{Caution:} For compatibility with @sc{matlab}, Octave's strncmp\n\ function returns 1 if the character strings are equal, and 0 otherwise.\n\ This is just the opposite of the corresponding C library function.\n\ @seealso{strncmpi, strcmp, strcmpi}\n\ @end deftypefn")
 DEFUN (list_in_columns, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} list_in_columns (@var{arg}, @var{width})\n\ Return a string containing the elements of @var{arg} listed in\n\ columns with an overall maximum width of @var{width}. The argument\n\ @var{arg} must be a cell array of character strings or a character array.\n\ If @var{width} is not specified, the width of the terminal screen is used.\n\ Newline characters are used to break the lines in the output string.\n\ For example:\n\ \n\ @example\n\ @group\n\ list_in_columns (@{\"abc\", \"def\", \"ghijkl\", \"mnop\", \"qrs\", \"tuv\"@}, 20)\n\ @result{} ans = abc mnop\n\ def qrs\n\ ghijkl tuv\n\ \n\ whos ans\n\ @result{}\n\ Variables in the current scope:\n\ \n\ Attr Name Size Bytes Class\n\ ==== ==== ==== ===== =====\n\ ans 1x37 37 char\n\ \n\ Total is 37 elements using 37 bytes\n\ @end group\n\ @end example\n\ \n\ @seealso{terminal_size}\n\ @end deftypefn")

Function Documentation

DEFUN ( list_in_columns  ,
args   
)

DEFUN ( strncmp  ,
args   
)

DEFUN ( strcmp  ,
args   
)

DEFUN ( ischar  ,
args   
)

DEFUN ( strvcat  ,
args   
)

DEFUN ( char  ,
args   
)