gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dc_string::strinclude Interface Reference

Public Member Functions

logical function str_include_ac (carray, string, ignore_space, ignore_case)
 

Detailed Description

Definition at line 201 of file dc_string.f90.

Member Function/Subroutine Documentation

◆ str_include_ac()

logical function dc_string::strinclude::str_include_ac ( character(*), dimension(:), intent(in)  carray,
character(*), intent(in)  string,
logical, intent(in), optional  ignore_space,
logical, intent(in), optional  ignore_case 
)

Check if array contains string

Returns .true. if character array carray has an element equal to string. Beginning and trailing spaces are ignored by default. If ignore_space is .false., beginning spaces are not ignored. If ignore_case is .true., comparison is case-insensitive.

Parameters
[in]carrayCharacter array to search
[in]stringString to find
[in]ignore_spaceIf .false., do not ignore leading spaces (default: .true.)
[in]ignore_caseIf .true., ignore case (default: .false.)
Returns
.true. if string is found in carray

Definition at line 550 of file dc_string.f90.

552 character(*), intent(in):: carray(:)
553 character(*), intent(in):: string
554 logical, intent(in), optional:: ignore_space
555 logical, intent(in), optional:: ignore_case
556 integer:: array_size, i
557 logical:: ignore_space_work, ignore_case_work
558 continue
559 ignore_space_work = .true.
560 if ( present(ignore_space) ) then
561 if ( .not. ignore_space ) then
562 ignore_space_work = .false.
563 end if
564 end if
565 ignore_case_work = .false.
566 if ( present(ignore_case) ) then
567 if ( ignore_case ) then
568 ignore_case_work = .true.
569 end if
570 end if
571 array_size = size(carray)
572 do i = 1, array_size
573 if ( ignore_space_work ) then
574 if ( ignore_case_work ) then
575 result = &
576 & strieq_cc( trim( adjustl( carray(i) ) ), &
577 & trim( adjustl( string ) ) )
578 else
579 result = &
580 & ( trim( adjustl( carray(i) ) ) == trim( adjustl( string ) ) )
581 end if
582 else
583 if ( ignore_case_work ) then
584 result = &
585 & strieq_cc( trim( carray(i) ), trim( string ) )
586 else
587 result = ( trim(carray(i)) == trim(string) )
588 end if
589 end if
590 if (result) return
591 end do

The documentation for this interface was generated from the following file: