slice Interface

public interface slice

Extracts characters from the input string to return a new string

Version: experimental


Contents


Module Procedures

private elemental function slice_string(string, first, last, stride) result(sliced_string)

Extract the characters from the region between 'first' and 'last' index (both inclusive) of the input 'string' by taking strides of length 'stride' Returns a new string

Arguments

TypeIntentOptionalAttributesName
type(string_type), intent(in) :: string
integer, intent(in), optional :: first
integer, intent(in), optional :: last
integer, intent(in), optional :: stride

Return Value type(string_type)

private pure function slice_char(string, first, last, stride) result(sliced_string)

Extract the characters from the region between 'first' and 'last' index (both inclusive) of the input 'string' by taking strides of length 'stride' Returns a new string

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(in) :: string
integer, intent(in), optional :: first
integer, intent(in), optional :: last
integer, intent(in), optional :: stride

Return Value character(len=:),allocatable