Debian Codegraph @

doc/src/intrinsics/character/adjustr.md

raw
1 # adjustr(string): Right Adjust String
2
3 Right adjust a string.
4
5 ## Declaration
6
7 ### Syntax
8
9 ```fortran
10 retval = adjustr(string)
11 elemental function adjustr(string)
12 ```
13
14 ### Arguments
15
16 `string`: the input value must be of character type.
17
18 ### Return value
19
20 The return value is of type character and of the same kind as of input value
21 `string`, with trailing spaces removed and same number of spaces added at the
22 start.
23
24 ## Description
25
26 **adjustr(string)** adjusts input string by removing any trailing spaces and
27 adding same number of spaces at the start of the input string.
28
29 ## Types
30
31 Supported argument type is character.
32
33 ```fortran
34
35 interface repeat
36 module procedure repeati32, repeati64
37 end interface
38
39 contains
40
41 function adjustr(string)
42 character(len=*), intent(in) :: string
43 end function
44 ```
45
46 ## Examples
47
48 ```fortran
49 program intrinsics_adjustr
50 implicit none
51 character(*), parameter :: s1 = "A B "
52 print *, adjustr(s1)
53 end program
54 ```
55
56 **Result:**
57
58 ```
59 A B
60 ```
61
62 ## See Also
63
64 [adjustl](adjustl.md).