! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

! Example 6.11. Substring input and output.
  program G11
    implicit none
    integer, parameter :: SL = 12
    character (len = SL) :: El_59
! start program G11
    El_59 = "Praseodymium"
    read (unit = *, fmt = *) El_59(5: 9)  ! Input record contains "XXXXX".
    write (unit = *, fmt = *) El_59  ! Prints: PrasXXXXXium.
    write (unit = *, fmt = *) El_59(3: 6)  ! Prints: asXX.
    stop
  end program G11
