subroutinetag_atpureprivate
pure subroutine tag_at(line, at, tag)
The tag at position at of line, in lowercase, or ''.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| line | character(len=*) | in | the line | |
| at | integer | in | the position of | |
| tag | character(len=:) | out | allocatable | the tag |
Source
Show the code
pure subroutine tag_at(line, at, tag)
character(len=*), intent(in) :: line !! the line
integer, intent(in) :: at !! the position of `<`
character(len=:), allocatable, intent(out) :: tag !! the tag
integer :: n
tag = ''
if (at + 1 > len(line)) return
n = verify(line(at + 1:)//' ', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
if (n > 1) tag = lowercase(line(at + 1:at + n - 1))
end subroutine tag_at