Skip to content

Instantly share code, notes, and snippets.

@drhirsch
Forked from ponderomotion/splitstring.f90
Last active October 4, 2015 07:06
Show Gist options
  • Save drhirsch/0af6832a9e0c61ecd81d to your computer and use it in GitHub Desktop.
Save drhirsch/0af6832a9e0c61ecd81d to your computer and use it in GitHub Desktop.
Split a string into 2 either side a delimiter in FORTRAN
! split a string into 2 either side of a delimiter token
function split(instr, delm)
implicit none
CHARACTER(len=80),intent(in) :: instr,delm
INTEGER :: idx
idx = scan(instr,delm)
split = instr(1:idx-1)
END function split
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment