%N substr %F $MIR/src/subs/match.for
%D Returns the n-th substring from the input string
%P bpw
%: strings
%B
      character*(*) function substr ( string, n )
      character*(*) string
      integer       n

 This takes as input a string which consists of a comma-separated list of
 substrings and an integer. It returns with the substring corresponding to
 the n-th position. E.g. substring('a,b,c,d,e',3) equals 'c'.

 If n is an illegal number, i.e. 0 or larger than the number of substrings
 in string, an empty string is returned.

 Input:
   string:     comma-separated list of substrings
   n:          position of requested substring in the list
