srepeat_character_string Function

private elemental function srepeat_character_string(self, rstring, ncopies) result(repeated)

Arguments

Type IntentOptional AttributesName
class(string), intent(in) :: self

String to be repeated.

character(kind=CK,len=*), intent(in) :: rstring

String to be repeated.

integer, intent(in) :: ncopies

Number of string copies.

Return Value type(string)

Repeated string.

Description

Concatenates several copies of an input string.


Source Code

  elemental function srepeat_character_string(self, rstring, ncopies) result(repeated)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Concatenates several copies of an input string.
  !---------------------------------------------------------------------------------------------------------------------------------
  class(string),             intent(in) :: self     !< String to be repeated.
  character(kind=CK, len=*), intent(in) :: rstring  !< String to be repeated.
  integer,                   intent(in) :: ncopies  !< Number of string copies.
  type(string)                          :: repeated !< Repeated string.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  repeated%raw = repeat(string=rstring, ncopies=ncopies)
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction srepeat_character_string