@@ -6,22 +6,22 @@ defmodule String do
6
6
7
7
The functions in this module act according to the
8
8
Unicode Standard, version 6.2.0. For example,
9
- `titlecase `, `downcase`, `strip` are provided by this
9
+ `capitalize/1 `, `downcase/1 `, `strip/1 ` are provided by this
10
10
module.
11
11
12
12
Besides this module, Elixir provides more low-level
13
- operations that works directly with binaries. Some
13
+ operations that work directly with binaries. Some
14
14
of those can be found in the `Kernel` module, as:
15
15
16
- * `binary_part/2` and `binary_part /3` - retrieves part of the binary
17
- * `bit_size/1` and `byte_size/1` - size related functions
18
- * `is_bitstring/1` and `is_binary/1` - type checking function
19
- * Plus a bunch of conversion functions, like `binary_to_atom/2`,
20
- `binary_to_integer/2`, `binary_to_term/1` and their opposite
21
- like `integer_to_binary/2`
16
+ * `Kernel. binary_part/2` and `Kernelbinary_part /3` - retrieves part of the binary
17
+ * `Kernel. bit_size/1` and `Kernel. byte_size/1` - size related functions
18
+ * `Kernel. is_bitstring/1` and `Kernel. is_binary/1` - type checking function
19
+ * Plus a number of conversion functions, like `Kernel. binary_to_atom/2`,
20
+ `Kernel. binary_to_integer/2`, `Kernel. binary_to_term/1` and their opposite
21
+ like `Kernel. integer_to_binary/2`
22
22
23
- Finally, [ the `:binary` module](http://erlang.org/doc/man/binary.html)
24
- provides a couple other functions that works on the byte level.
23
+ Finally, the [ `:binary` module](http://erlang.org/doc/man/binary.html)
24
+ provides a few other functions that work on the byte level.
25
25
26
26
## Codepoints and graphemes
27
27
@@ -93,7 +93,7 @@ defmodule String do
93
93
codepoint needs to be rejected.
94
94
95
95
This module relies on this behaviour to ignore such invalid
96
- characters. For example, `String. length` is going to return
96
+ characters. For example, `length/1 ` is going to return
97
97
a correct result even if an invalid codepoint is fed into it.
98
98
99
99
In other words, this module expects invalid data to be detected
@@ -108,7 +108,7 @@ defmodule String do
108
108
109
109
@ doc """
110
110
Checks if a string is printable considering it is encoded
111
- as UTF-8. Returns true if so, false otherwise.
111
+ as UTF-8. Returns ` true` if so, ` false` otherwise.
112
112
113
113
## Examples
114
114
@@ -200,7 +200,7 @@ defmodule String do
200
200
end
201
201
202
202
@ doc """
203
- Splits a string on sub strings at each Unicode whitespace
203
+ Splits a string on substrings at each Unicode whitespace
204
204
occurrence with leading and trailing whitespace ignored.
205
205
206
206
## Examples
@@ -217,12 +217,12 @@ defmodule String do
217
217
defdelegate split ( binary ) , to: String.Unicode
218
218
219
219
@ doc """
220
- Divides a string into sub strings based on a pattern,
221
- returning a list of these sub string . The pattern can
220
+ Divides a string into substrings based on a pattern,
221
+ returning a list of these substrings . The pattern can
222
222
be a string, a list of strings or a regular expression.
223
223
224
224
The string is split into as many parts as possible by
225
- default, unless the `global` option is set to false.
225
+ default, unless the `global` option is set to ` false` .
226
226
227
227
## Examples
228
228
@@ -258,7 +258,7 @@ defmodule String do
258
258
end
259
259
260
260
@ doc """
261
- Convert all characters on the given string to upcase .
261
+ Convert all characters on the given string to uppercase .
262
262
263
263
## Examples
264
264
@@ -274,7 +274,7 @@ defmodule String do
274
274
defdelegate upcase ( binary ) , to: String.Unicode
275
275
276
276
@ doc """
277
- Convert all characters on the given string to downcase .
277
+ Convert all characters on the given string to lowercase .
278
278
279
279
## Examples
280
280
@@ -291,11 +291,11 @@ defmodule String do
291
291
292
292
@ doc """
293
293
Converts the first character in the given string to
294
- titlecase and the remaining to downcase .
294
+ uppercase and the remaining to lowercase .
295
295
296
296
This relies on the titlecase information provided
297
297
by the Unicode Standard. Note this function makes
298
- no attempt in capitalizing all words in the string
298
+ no attempt to capitalize all words in the string
299
299
(usually known as titlecase).
300
300
301
301
## Examples
@@ -430,7 +430,7 @@ defmodule String do
430
430
@ doc """
431
431
Returns a new binary based on `subject` by replacing the parts
432
432
matching `pattern` for `replacement`. By default, it replaces
433
- all entries, except if the `global` option is set to false.
433
+ all entries, except if the `global` option is set to ` false` .
434
434
435
435
If the replaced part must be used in `replacement`, then the
436
436
position or the positions where it is to be inserted must be
@@ -533,7 +533,7 @@ defmodule String do
533
533
remaining of the string or `:no_codepoint` in case
534
534
the string reached its end.
535
535
536
- As the other functions in the String module, this
536
+ As with other functions in the String module, this
537
537
function does not check for the validity of the codepoint.
538
538
That said, if an invalid codepoint is found, it will
539
539
be returned by this function.
@@ -674,7 +674,7 @@ defmodule String do
674
674
675
675
@ doc """
676
676
Returns the last grapheme from an utf8 string,
677
- nil if the string is empty.
677
+ ` nil` if the string is empty.
678
678
679
679
## Examples
680
680
@@ -762,7 +762,7 @@ defmodule String do
762
762
@ doc """
763
763
Returns a substring starting at the offset given by the first, and
764
764
a length given by the second.
765
- If the offset is greater than string length, than it returns nil.
765
+ If the offset is greater than string length, than it returns ` nil` .
766
766
767
767
## Examples
768
768
@@ -827,8 +827,8 @@ defmodule String do
827
827
828
828
@ doc """
829
829
Converts a string to an integer. If successful, returns a
830
- tuple of form {integer, remainder of string}. If unsuccessful,
831
- returns :error.
830
+ tuple of the form ` {integer, remainder of string}` . If unsuccessful,
831
+ returns ` :error` .
832
832
833
833
## Examples
834
834
@@ -852,9 +852,9 @@ defmodule String do
852
852
853
853
@ doc """
854
854
Converts a string to a float. If successful, returns a
855
- tuple of form {float, remainder of string}. If unsuccessful,
856
- returns :error. If given an integer value, will return
857
- same as to_integer/1.
855
+ tuple of the form ` {float, remainder of string}` . If unsuccessful,
856
+ returns ` :error` . If given an integer value, will return
857
+ the same value as ` to_integer/1` .
858
858
859
859
## Examples
860
860
@@ -885,8 +885,8 @@ defmodule String do
885
885
end
886
886
887
887
@ doc """
888
- Returns true if `string` starts with any of the prefixes given, otherwise
889
- false. `prefixes` can be either a single prefix or a list of prefixes.
888
+ Returns ` true` if `string` starts with any of the prefixes given, otherwise
889
+ ` false` . `prefixes` can be either a single prefix or a list of prefixes.
890
890
891
891
## Examples
892
892
@@ -921,8 +921,8 @@ defmodule String do
921
921
end
922
922
923
923
@ doc """
924
- Returns true if `string` ends with any of the suffixes given, otherwise
925
- false. `suffixes` can be either a single suffix or a list of suffixes.
924
+ Returns ` true` if `string` ends with any of the suffixes given, otherwise
925
+ ` false` . `suffixes` can be either a single suffix or a list of suffixes.
926
926
927
927
## Examples
928
928
@@ -960,7 +960,7 @@ defmodule String do
960
960
end
961
961
962
962
@ doc """
963
- Returns true if `string` contains match, otherwise false.
963
+ Returns ` true` if `string` contains match, otherwise ` false` .
964
964
`matches` can be either a single string or a list of strings.
965
965
966
966
## Examples
0 commit comments