(octave.info)Creating Strings


Next: Comparing Strings Prev: Character Arrays Up: Strings
Enter node , (file) or (file)node

5.3 Creating Strings
====================

The easiest way to create a string is, as illustrated in the
introduction, to enclose a text in double-quotes or single-quotes.  It
is however possible to create a string without actually writing a text.
The function ‘blanks’ creates a string of a given length consisting only
of blank characters (ASCII code 32).

 -- : blanks (N)
     Return a string of N blanks.

     For example:

          blanks (10);
          whos ans
               ⇒
                Attr Name        Size                     Bytes  Class
                ==== ====        ====                     =====  =====
                     ans         1x10                        10  char

     See also: Note: repmat.

Concatenating Strings
Converting Numerical Data to Strings

automatically generated by info2www version 1.2.2.9