Skip to content

Commit a3d5af5

Browse files
Fix documentation
The parsing regex listed in String(_, radix:) is incorrect.
1 parent bdb4b89 commit a3d5af5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/IntegerParsing.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ extension ${Self} {
119119
/// Construct from an ASCII representation in the given `radix`.
120120
///
121121
/// If `text` does not match the regular expression
122-
/// "[+-][0-9a-zA-Z]+", or the value it denotes in the given `radix`
122+
/// "[+-]?[0-9a-zA-Z]+", or the value it denotes in the given `radix`
123123
/// is not representable, the result is `nil`.
124124
public init?(_ text: String, radix: Int = 10) {
125125
if let value = _parseAsciiAs${'' if signed else 'U'}IntMax(

0 commit comments

Comments
 (0)