Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2026.0.0 - Français


strings

Character strings

Description

Strings are defined as 'string' (between quotes) or "string" (between doublequotes); matrices of strings are defined as usual constant matrices.

Strings can have a single or several characters. Multi-line strings are usually defined as a column vector of lines.

Concatenation of two strings is made by a +: string1 + string2.

Examples

['this','is'; 'a 2x2','matrix']
"matrix"=="mat"+"rix"
length("hello") // returns 5
part("hello", 2) // returns "e"
part("hello", 1:4) // returns "hell"
strcat(["hello", " ", "world"]) // returns "hello world"
mgetl("SCI/README.md") // reads a text file line by line

See also

  • part — Extraction of characters from strings
  • length — Number of characters of a string. Number of elements of an array or list.
  • strcat — concatenates character strings
  • mgetl — reads lines from an text file
  • xstring — dessine des chaînes de caractères
Report an issue
<< rational types type >>

Copyright (c) 2022-2025 (Dassault Systèmes S.E.)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 16 09:08:34 CEST 2025