srepeat_string_string Function

public elemental function srepeat_string_string(self, ncopies) result(repeated)

Arguments

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

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.

Called By

proc~~srepeat_string_string~~CalledByGraph proc~srepeat_string_string srepeat_string_string interface~repeat repeat interface~repeat->proc~srepeat_string_string
Help

Source Code

  elemental function srepeat_string_string(self, ncopies) result(repeated)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Concatenates several copies of an input string.
  !---------------------------------------------------------------------------------------------------------------------------------
  class(string), intent(in) :: self     !< String to be repeated.
  integer,       intent(in) :: ncopies  !< Number of string copies.
  type(string)              :: repeated !< Repeated string.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  repeated%raw = repeat(string=self%raw, ncopies=ncopies)
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction srepeat_string_string