Main Content

String

R2026b
Blocks for composing, parsing, and converting string signals, such as String Constant and String To ASCII

Use blocks from the String library to work with text data in your model as string-valued signals. You can compose formatted strings, parse string content, compare strings, and convert between strings and numeric types.

To add blocks from this library to your model, see Add Blocks to Models.

Blocks

ASCII to String blockASCII to StringUint8 vector signal to string signal
Compose String blockCompose StringCompose output string signal based on specified format and input signals
Scan String blockScan StringScan input string and convert to signals per specified format
String Compare blockString CompareCompare two input strings
String Concatenate blockString ConcatenateConcatenate input strings to form one output string
String Constant blockString ConstantOutput specified string
String Contains blockString ContainsDetermine if string contains, starts with, or ends with pattern
String Count blockString CountCount occurrences of pattern in string
String Find blockString FindReturn index of first occurrence of pattern string
String Length blockString LengthOutput number of characters in input string
String to ASCII blockString to ASCIIConvert string signal to uint8 vector
String to Double blockString to DoubleConvert string signal to double signal
String to Enum blockString to EnumInput string signal to enumerated signal
String to Single blockString to SingleConvert string signal to single signal
Substring blockSubstringExtract substring from input string signal
To String blockTo StringConvert input signal to string signal

Tools

Library BrowserFind and add blocks to model

Topics