Logo

Programming-Idioms

History of Idiom 38 > diff from v47 to v48

Edit summary for version 48 by tkoenig:
New Fortran implementation by user [tkoenig]

Version 47

2019-09-26, 16:49:58

Version 48

2019-09-26, 17:10:03

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration
Code
character(len=:), allocatable :: t

  t = s(i:j-1)
Comments bubble
In Fortran, characters start with index one.