National Instruments 370760B-01 Calculator User Manual


 
substr 361
substr
Syntax
littlestring = substr(bigstring,charindex,{skipChks})
Parameter List
Inputs: bigstring Input string (a 1×1 string matrix)
charindex vector indexing the characters to be returned in the output.
Keywords: skipChks Boolean specifying that syntax checking is to be skipped.
Outputs: littlestring Output string
Description
substr takes characters from the string, bigstring and concatentates them to from the
output, littlestring. The vector, charindex, determines the characters and their
order.
This function allows the user to select substrings from an input string. However, as
shown in the example, there is no requirement that the characters specified in charindex
be contiguous or non-repeated.
To find a specified character in a string use the function: index.
Example
alphabet = " abcdefghijklmnopqrstuvwxyz"
mantra = substr(alphabet,[14,22,1,19,22,13,6,20])?