Routine finds the first instance of a character from delims
in the the
string str
. The characters before the found delimiter are output in
before
. The characters after the found delimiter are output in str
.
Repeated applications of this routine can be used to parse a string into its
component parts. Multiple whitespaces of str
are compacted into a single
whitespace before splitting begins. If either str
or delimiter
is
empty, an empty string is retured in before
and str
remains
unchanged.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | str | |||
character(len=*), | intent(in) | :: | delimiter | |||
character(len=:), | intent(out), | allocatable | :: | before |