Main Content

strlength

Determine length of string in Stateflow chart

Since R2021b

Description

L = strlength(str) returns the number of characters in the string str.

example

Note

The operator strlength is not supported in Stateflow® charts that use C as the action language. For similar functionality, use strlen.

Examples

expand all

Return a value of 13, the number of characters in the string.

str = "Hello, world!";
L = strlength(str);

Stateflow chart that uses the string operator in a state.

Input Arguments

expand all

Input string, specified as a string scalar. Enclose literal strings with double quotes.

Example: "Hello"

Version History

Introduced in R2021b