slice Interface

public interface slice

Extracts characters from the input string to return a new string

Version: experimental


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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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