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
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_type), | intent(in) | :: | string | |||
| integer, | intent(in), | optional | :: | first | ||
| integer, | intent(in), | optional | :: | last | ||
| integer, | intent(in), | optional | :: | stride |
elemental function slice_string(string, first, last, stride) result(sliced_string) type(string_type), intent(in) :: string integer, intent(in), optional :: first, last, stride type(string_type) :: sliced_string sliced_string = string_type(slice(char(string), first, last, stride)) end function slice_string