sscan_string_character Function

public elemental function sscan_string_character(self, set, back) result(i)

Arguments

Type IntentOptional AttributesName
class(string), intent(in) :: self

The string.

character(kind=CK,len=*), intent(in) :: set

Searched set.

logical, intent(in), optional :: back

Start of the last occurrence rather than the first.

Return Value integer

Result of the search.

Description

Return the leftmost (if back is either absent or equals false, otherwise the rightmost) character of string that is in set.

Called By

proc~~sscan_string_character~~CalledByGraph proc~sscan_string_character sscan_string_character interface~scan scan interface~scan->proc~sscan_string_character
Help

Source Code

  elemental function sscan_string_character(self, set, back) result(i)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Return the leftmost (if `back` is either absent or equals false, otherwise the rightmost) character of string that is in `set`.
  !---------------------------------------------------------------------------------------------------------------------------------
  class(string),             intent(in)           :: self  !< The string.
  character(kind=CK, len=*), intent(in)           :: set   !< Searched set.
  logical,                   intent(in), optional :: back  !< Start of the last occurrence rather than the first.
  integer                                         :: i     !< Result of the search.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  if (allocated(self%raw)) then
    i = scan(string=self%raw, set=set, back=back)
  else
    i = 0
  endif
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction sscan_string_character