substr 361
substr
Syntax
littlestring = substr(bigstring,charindex,{skipChks})
Parameter Li st
Inputs: bigstring Input string (a 1×1 string matrix)
charindex vectorindexing the characters to be returned in the output.
Keywords: skipChks Booleansp ecifying thatsyntax checking is to be skipped.
Outputs: littlestring Output string
Description
substr takes charactersfrom 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 requirementthat the characters specified in charindex
be contiguous or non-repeated.
Tofind a s pecified characterin a string use the function: index.
Example
alphabet = " abcdefghijklmnopqrstuvwxyz"
mantra = substr(alphabet,[14,22,1,19,22,13,6,20])?