IsPresent
Returns true if a substring pattern is found within string.
note
This routine does not handle trailing spaces that can be eliminated by TRIM(). So, strings should be trimmed when passing into function.
Interface
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE PURE FUNCTION isPresent(chars, pattern) RESULT(Ans)
CHARACTER(*), INTENT(IN) :: chars
CHARACTER(*), INTENT(IN) :: pattern
LOGICAL(LGT) :: ans
END FUNCTION isPresent
END INTERFACE
program main
use easifemBase
implicit none
CHARACTER( LEN = 100 ) :: astr = "hello world, hello people"
CALL OK(IsPresent(astr, "hello"), "test(1): " )
end program main