STRMID function extracts a substring from a string expression. The result of the function is a string of
characters taken from
, starting at character position
Result = STRMID(
Expression, First_Character [, Length
The expression from which the substring is to be extracted. If this argument is not a string, it is converted using IDL's default formatting rules. If
is an array, the result is an array with the same structure, where each element contains the substring of the corresponding
The starting position within
at which the substring starts. The first character position is 0.
The length of the substring. If there are not enough characters left in the main string to obtain
characters, the substring is truncated. If
is not supplied, STRMID extracts all characters from the specified start position to the end of the string.
If the variable B contains the string "IDL is fun", the substring "is" can be extracted and stored in the variable C with the command:
C = STRMID(B, 4, 2)