@@ -35,8 +35,7 @@ Converts input character variable to all lowercase.
35
35
#### Syntax
36
36
37
37
``` f90
38
- res = to_lower("HELLO!")
39
- ! res == "hello!"
38
+ res = [stdlib_asciii(module):to_lower(function)]](string)
40
39
```
41
40
42
41
#### Class
@@ -51,6 +50,15 @@ Pure function.
51
50
52
51
The result is an intrinsic character type of the same length as ` string ` .
53
52
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
+ ```
54
62
55
63
### ` to_upper `
56
64
@@ -64,9 +72,8 @@ Converts input character variable to all uppercase.
64
72
65
73
#### Syntax
66
74
67
- ```
68
- res = to_upper("hello!")
69
- ! res == "HELLO!"
75
+ ``` fortran
76
+ res = [[stdlib_ascii(module):to_upper(function)]](string)
70
77
```
71
78
72
79
#### Class
@@ -81,6 +88,15 @@ Pure function.
81
88
82
89
The result is an intrinsic character type of the same length as ` string ` .
83
90
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
+ ```
84
100
85
101
### ` to_title `
86
102
@@ -90,18 +106,14 @@ Experimental
90
106
91
107
#### Description
92
108
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.
95
112
96
113
#### Syntax
97
114
98
115
```
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)
105
117
```
106
118
107
119
#### Class
@@ -116,6 +128,17 @@ Pure function.
116
128
117
129
The result is an intrinsic character type of the same length as ` string ` .
118
130
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
+ ```
119
142
120
143
### ` reverse `
121
144
@@ -130,10 +153,7 @@ Reverses the order of all characters in the input character type.
130
153
#### Syntax
131
154
132
155
``` 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)
137
157
```
138
158
139
159
#### Class
@@ -147,3 +167,12 @@ Pure function.
147
167
#### Result value
148
168
149
169
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