This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

String Length

Output number of characters in input string

  • Library:
  • Simulink / String


The String Length block outputs the number of characters in the input string. For example, you can use the String Length block to move focus of attention to a particular location in a string.



expand all

Input string, specified as a scalar.

Data Types: string


expand all

Number of characters in the input string, specified as a scalar.

Data Types: uint32

Block Characteristics

Data Types

integer | string

Direct Feedthrough


Multidimensional Signals


Variable-Size Signals


Zero-Crossing Detection


Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2018a