]>
Commit | Line | Data |
---|---|---|
c63539ff ML |
1 | .. |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. index:: REPEAT, string, repeat, string, concatenate | |
7 | ||
8 | .. _repeat: | |
9 | ||
10 | REPEAT --- Repeated string concatenation | |
11 | ***************************************** | |
12 | ||
13 | .. function:: REPEAT(STRING, NCOPIES) | |
14 | ||
15 | Concatenates :samp:`{NCOPIES}` copies of a string. | |
16 | ||
17 | :param STRING: | |
18 | Shall be scalar and of type ``CHARACTER``. | |
19 | ||
20 | :param NCOPIES: | |
21 | Shall be scalar and of type ``INTEGER``. | |
22 | ||
23 | :return: | |
24 | A new scalar of type ``CHARACTER`` built up from :samp:`{NCOPIES}` copies | |
25 | of :samp:`{STRING}`. | |
26 | ||
27 | Standard: | |
28 | Fortran 90 and later | |
29 | ||
30 | Class: | |
31 | Transformational function | |
32 | ||
33 | Syntax: | |
34 | .. code-block:: fortran | |
35 | ||
36 | RESULT = REPEAT(STRING, NCOPIES) | |
37 | ||
38 | Example: | |
39 | .. code-block:: fortran | |
40 | ||
41 | program test_repeat | |
42 | write(*,*) repeat("x", 5) ! "xxxxx" | |
3ed1b4ce | 43 | end program |