Concatenates several copies of an input string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(string), | intent(in) | :: | self | String to be repeated. |
||
| integer, | intent(in) | :: | ncopies | Number of string copies. |
Repeated string.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
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