index Interface

public interface index

Position of a substring within a string.

Returns the position of the start of the leftmost or rightmost occurrence of string substring in string, counting from one. If substring is not present in string, zero is returned.

This method is elemental and returns a default integer scalar value.


Contents


Module Procedures

private elemental function index_object_object(string, substring, back) result(pos)

Position of a sequence of character within a character sequence.

Arguments

Type IntentOptional AttributesName
class(string_class), intent(in) :: string
class(string_class), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer

private elemental function index_object_string(string, substring, back) result(pos)

Position of a sequence of character within a character sequence.

Arguments

Type IntentOptional AttributesName
class(string_class), intent(in) :: string
type(string_type), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer

private elemental function index_object_char(string, substring, back) result(pos)

Position of a sequence of character within a character sequence.

Arguments

Type IntentOptional AttributesName
class(string_class), intent(in) :: string
character(len=*), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer

private elemental function index_string_object(string, substring, back) result(pos)

Position of a sequence of character within a character sequence.

Arguments

Type IntentOptional AttributesName
type(string_type), intent(in) :: string
class(string_class), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer

private elemental function index_char_object(string, substring, back) result(pos)

Position of a sequence of character within a character sequence.

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: string
class(string_class), intent(in) :: substring
logical, intent(in), optional :: back

Return Value integer