functioncontains_string
logical function contains_string(list, s)
True if s is in list.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(string_t) | in | dimension(:) | the list |
| s | character(len=*) | in | the string to find |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| contains_string | logical |
Source
Show the code
logical function contains_string(list, s)
type(string_t), intent(in) :: list(:) !! the list
character(len=*), intent(in) :: s !! the string to find
integer :: k
contains_string = .false.
do k = 1, size(list)
if (list(k)%s == s .and. len(list(k)%s) == len(s)) then
contains_string = .true.
return
end if
end do
end function contains_string