Main Content

reverse

Reverse order of characters in strings

Description

example

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

Note

Only Stateflow® charts that use MATLAB® as the action language support the startsWith operator.

Examples

expand all

h = "Hello, world!"
x = reverse(h)

Stateflow chart that uses the replace operator in a state.

Results from stateflow chart that uses the replace operator in a state.

Limitations

Introduced in R2021b