Extract the section of buffer that occurs after the field separator fs
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | buffer |
Input buffer |
||
| character(len=1), | intent(in), | optional | :: | fs |
Field separator |
Extracted value
function get_val(buffer, fs) result(output) !! Extract the section of buffer that occurs after the field separator fs implicit none ! Arguments character(*), intent(in) :: buffer !! Input buffer character(1), intent(in), optional :: fs !! Field separator ! Local variables character(:), allocatable :: output !! Extracted value character(1) :: fs_ !! Field separator fs_ = '=' if(present(fs)) fs_ = fs output = trim(adjustl(buffer((scan(buffer, fs_) + 1):))) end function get_val