functionfirst_word_ofpureprivate
pure character(len=word_length(text)) function first_word_of(text) result(word)
The first blank-separated word of text, after any leading blanks.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| text | character(len=*) | in | the text |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| word | character(len=word_length(text)) | private |
Source
Show the code
pure function first_word_of(text) result(word)
character(len=*), intent(in) :: text !! the text
character(len=word_length(text)) :: word
integer :: a
a = verify(text//'x', ' ')
word = text(a:)
end function first_word_of