Skip to content

Commit e47f028

Browse files
awvwgkjvdp1
andauthored
Apply restructring of specs from review
Co-authored-by: Jeremie Vandenplas <[email protected]>
1 parent 6720abd commit e47f028

File tree

1 file changed

+46
-17
lines changed

1 file changed

+46
-17
lines changed

doc/specs/stdlib_ascii.md

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ Converts input character variable to all lowercase.
3535
#### Syntax
3636

3737
```f90
38-
res = to_lower("HELLO!")
39-
! res == "hello!"
38+
res = [stdlib_asciii(module):to_lower(function)]](string)
4039
```
4140

4241
#### Class
@@ -51,6 +50,15 @@ Pure function.
5150

5251
The result is an intrinsic character type of the same length as `string`.
5352

53+
#### Example
54+
55+
```fortran
56+
program demo_to_lower
57+
use stdlib_ascii, only : to_lower
58+
implicit none
59+
print'(a)', to_lower("HELLo!") ! returns "hello!"
60+
end program demo_to_lower
61+
```
5462

5563
### `to_upper`
5664

@@ -64,9 +72,8 @@ Converts input character variable to all uppercase.
6472

6573
#### Syntax
6674

67-
```
68-
res = to_upper("hello!")
69-
! res == "HELLO!"
75+
```fortran
76+
res = [[stdlib_ascii(module):to_upper(function)]](string)
7077
```
7178

7279
#### Class
@@ -81,6 +88,15 @@ Pure function.
8188

8289
The result is an intrinsic character type of the same length as `string`.
8390

91+
#### Example
92+
93+
```fortran
94+
program demo_to_upper
95+
use stdlib_ascii, only : to_upper
96+
implicit none
97+
print'(a)', to_upper("hello!") ! returns "HELLO!"
98+
end program demo_to_upper
99+
```
84100

85101
### `to_title`
86102

@@ -90,18 +106,14 @@ Experimental
90106

91107
#### Description
92108

93-
Returns capitalized version of input character variable.
94-
The first alphanumeric character is capitalized.
109+
Returns a capitalized version of an input character variable.
110+
Only the first alphanumeric character is capitalized.
111+
All following characters will become lowercase.
95112

96113
#### Syntax
97114

98115
```
99-
res = to_title("hello!")
100-
! res == "Hello!"
101-
res = to_title("'enquoted'")
102-
! res == "'Enquoted'"
103-
res = to_title("1st")
104-
! res == "1st"
116+
res = [[stdlib_ascii(module):to_title(interface)]](string)
105117
```
106118

107119
#### Class
@@ -116,6 +128,17 @@ Pure function.
116128

117129
The result is an intrinsic character type of the same length as `string`.
118130

131+
#### Example
132+
133+
```fortran
134+
program demo_to_title
135+
use stdlib_ascii, only : to_title
136+
implicit none
137+
print*, to_title("hello!") ! returns "Hello!"
138+
print*, to_title("'enquoted'") ! returns "'Enquoted'"
139+
print*, to_title("1st") ! returns "1st"
140+
end program demo_to_title
141+
```
119142

120143
### `reverse`
121144

@@ -130,10 +153,7 @@ Reverses the order of all characters in the input character type.
130153
#### Syntax
131154

132155
```f90
133-
res = reverse("Hello, World!")
134-
! res == "!dlroW ,olleH"
135-
res = reverse(res)
136-
! res == "Hello, World!"
156+
res = [[stdlib_ascii(module):reverse(function)]](string)
137157
```
138158

139159
#### Class
@@ -147,3 +167,12 @@ Pure function.
147167
#### Result value
148168

149169
The result is an intrinsic character type of the same length as `string`.
170+
171+
#### Example
172+
173+
```fortran
174+
program demo_reverse
175+
use stdlib_ascii, only : reverse
176+
implicit none
177+
print'(a)', reverse("Hello, World!") ! returns "!dlroW ,olleH"
178+
end program demo_reverse

0 commit comments

Comments
 (0)