strlen

Determine length of string

Description

example

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

Note

The operator strlen is supported only in Stateflow® charts that use C as the action language.

Examples

expand all

Return a value of 9.

L = strlen("Stateflow");

Stateflow chart that uses the strlen operator in a state.

Tips

Enclose literal strings with single or double quotes.

Introduced in R2018b