slice Function

private pure function slice(self, istart, iend) result(raw)

Type Bound

string

Arguments

Type IntentOptional Attributes Name
class(string), intent(in) :: self
integer, intent(in) :: istart
integer, intent(in) :: iend

Return Value character(kind=CK, len=:), allocatable


Called by

proc~~slice~~CalledByGraph proc~slice string%slice proc~add_stream_attributes xml_tag%add_stream_attributes proc~add_stream_attributes->proc~slice program~volatile_doctest~1665 volatile_doctest program~volatile_doctest~1665->proc~slice program~volatile_doctest~749 volatile_doctest program~volatile_doctest~749->proc~slice none~add_attributes xml_tag%add_attributes none~add_attributes->proc~add_stream_attributes proc~set xml_tag%set proc~set->proc~add_stream_attributes proc~create_tag_flat create_tag_flat proc~create_tag_flat->proc~set proc~create_tag_nested create_tag_nested proc~create_tag_nested->proc~set proc~parse_from_string xml_file%parse_from_string proc~parse_from_string->proc~set program~foxy_test_add_attributes foxy_test_add_attributes program~foxy_test_add_attributes->none~add_attributes program~foxy_test_create_tag foxy_test_create_tag program~foxy_test_create_tag->proc~set interface~xml_tag xml_tag interface~xml_tag->proc~create_tag_flat interface~xml_tag->proc~create_tag_nested proc~parse~2 xml_file%parse proc~parse~2->proc~parse_from_string program~foxy_test_delete_tag foxy_test_delete_tag program~foxy_test_delete_tag->proc~parse~2 program~foxy_test_parse_file_simple foxy_test_parse_file_simple program~foxy_test_parse_file_simple->proc~parse~2 program~foxy_test_parse_string_nested_tags foxy_test_parse_string_nested_tags program~foxy_test_parse_string_nested_tags->proc~parse~2 program~foxy_test_parse_string_simple foxy_test_parse_string_simple program~foxy_test_parse_string_simple->proc~parse~2 program~foxy_test_write_tag foxy_test_write_tag program~foxy_test_write_tag->proc~parse~2

Source Code

   pure function slice(self, istart, iend) result(raw)
   !< Return the raw characters data sliced.
   !<
   !<```fortran
   !< type(string) :: astring
   !< astring = 'the Quick Brown fox Jumps over the Lazy Dog.'
   !< print "(A)", astring%slice(11,25)
   !<```
   !=> Brown fox Jumps <<<
   class(string), intent(in)              :: self   !< The string.
   integer,       intent(in)              :: istart !< Slice start index.
   integer,       intent(in)              :: iend   !< Slice end   index.
   character(kind=CK, len=:), allocatable :: raw    !< Raw characters data.

   if (allocated(self%raw)) then
      raw = self%raw(istart:iend)
   else
      raw = ''
   endif
   endfunction slice