Main Content

reverse

Reverse order of characters in strings in Stateflow chart

Since R2021b

Description

newStr = reverse(str) reverses the order of the characters in the string str.

example

Note

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

Examples

expand all

Reverse the order of characters and return the string "!dlrow ,olleH"

str = "Hello, world!";
newStr = reverse(str);

Stateflow chart that uses the reverse operator in a state.

Input Arguments

expand all

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

Example: "Hello"

Limitations

  • This operator does not support the use of Stateflow structure fields or messages. For more information about structures in Stateflow, see Access Bus Signals.

Version History

Introduced in R2021b

Go to top of page