@@ -83,7 +83,9 @@ func Create(name string) (*os.File, error)
83
83
func Lines(r io.Reader) iox.LineReader
84
84
func (r io.Reader) Gop_Enum() iox.LineIter
85
85
86
- // String converts the floating-point number f to a string,
86
+ // String is equivalent to strconv.FormatFloat(f, 'g', -1, 64)
87
+ //
88
+ // FormatFloat converts the floating-point number f to a string,
87
89
// according to the format fmt and precision prec. It rounds the
88
90
// result assuming that the original was obtained from a floating-point
89
91
// value of bitSize bits (32 for float32, 64 for float64).
@@ -110,12 +112,16 @@ func (f float64) String() string
110
112
// String is equivalent to FormatInt(int64(i), 10).
111
113
func (i int) String() string
112
114
113
- // String returns the string representation of i in the given base,
115
+ // String is equivalent to strconv.FormatInt(i, 10)
116
+ //
117
+ // FormatInt returns the string representation of i in the given base,
114
118
// for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z'
115
119
// for digit values >= 10.
116
120
func (i int64) String() string
117
121
118
- // String returns the string representation of i in the given base,
122
+ // String is equivalent to strconv.FormatUint(u, 10)
123
+ //
124
+ // FormatUint returns the string representation of i in the given base,
119
125
// for 2 <= base <= 36. The result uses the lower-case letters 'a' to 'z'
120
126
// for digit values >= 10.
121
127
func (u uint64) String() string
@@ -141,7 +147,9 @@ func (s string) Count(substr string) int
141
147
// Int is equivalent to ParseInt(s, 10, 0), converted to type int.
142
148
func (s string) Int() (int, error)
143
149
144
- // Int64 interprets a string s in the given base (0, 2 to 36) and
150
+ // Int64 is equivalent to strconv.ParseInt(s, 10, 64)
151
+ //
152
+ // ParseInt interprets a string s in the given base (0, 2 to 36) and
145
153
// bit size (0 to 64) and returns the corresponding value i.
146
154
//
147
155
// The string may begin with a leading sign: "+" or "-".
@@ -157,7 +165,7 @@ func (s string) Int() (int, error)
157
165
// correspond to int, int8, int16, int32, and int64.
158
166
// If bitSize is below 0 or above 64, an error is returned.
159
167
//
160
- // The errors that Int64 returns have concrete type *NumError
168
+ // The errors that ParseInt returns have concrete type *NumError
161
169
// and include err.Num = s. If s is empty or contains invalid
162
170
// digits, err.Err = ErrSyntax and the returned value is 0;
163
171
// if the value corresponding to s cannot be represented by a
@@ -168,35 +176,39 @@ func (s string) Int() (int, error)
168
176
// [integer literals]: https://go.dev/ref/spec#Integer_literals
169
177
func (s string) Int64() (i int64, err error)
170
178
171
- // Uint64 is like ParseInt but for unsigned numbers.
179
+ // Uint64 is equivalent to strconv.ParseUint(s, 10, 64)
180
+ //
181
+ // ParseUint is like ParseInt but for unsigned numbers.
172
182
//
173
183
// A sign prefix is not permitted.
174
184
func (s string) Uint64() (uint64, error)
175
185
176
- // Float converts the string s to a floating-point number
186
+ // Float is equivalent to strconv.ParseFloat(s, 64)
187
+ //
188
+ // ParseFloat converts the string s to a floating-point number
177
189
// with the precision specified by bitSize: 32 for float32, or 64 for float64.
178
190
// When bitSize=32, the result still has type float64, but it will be
179
191
// convertible to float32 without changing its value.
180
192
//
181
- // Float accepts decimal and hexadecimal floating-point numbers
193
+ // ParseFloat accepts decimal and hexadecimal floating-point numbers
182
194
// as defined by the Go syntax for [floating-point literals].
183
195
// If s is well-formed and near a valid floating-point number,
184
- // Float returns the nearest floating-point number rounded
196
+ // ParseFloat returns the nearest floating-point number rounded
185
197
// using IEEE754 unbiased rounding.
186
198
// (Parsing a hexadecimal floating-point value only rounds when
187
199
// there are more bits in the hexadecimal representation than
188
200
// will fit in the mantissa.)
189
201
//
190
- // The errors that Float returns have concrete type *NumError
202
+ // The errors that ParseFloat returns have concrete type *NumError
191
203
// and include err.Num = s.
192
204
//
193
- // If s is not syntactically well-formed, Float returns err.Err = ErrSyntax.
205
+ // If s is not syntactically well-formed, ParseFloat returns err.Err = ErrSyntax.
194
206
//
195
207
// If s is syntactically well-formed but is more than 1/2 ULP
196
208
// away from the largest floating point number of the given size,
197
- // Float returns f = ±Inf, err.Err = ErrRange.
209
+ // ParseFloat returns f = ±Inf, err.Err = ErrRange.
198
210
//
199
- // Float recognizes the string "NaN", and the (possibly signed) strings "Inf" and "Infinity"
211
+ // ParseFloat recognizes the string "NaN", and the (possibly signed) strings "Inf" and "Infinity"
200
212
// as their respective special floating point values. It ignores case when matching.
201
213
//
202
214
// [floating-point literals]: https://go.dev/ref/spec#Floating-point_literals
@@ -345,8 +357,13 @@ func (s string) SplitN(sep string, n int) []string
345
357
// as described in the documentation for SplitAfter.
346
358
func (s string) SplitAfterN(sep string, n int) []string
347
359
348
- // Replace returns a copy of s with all replacements performed.
349
- func (s string) Replace() string
360
+ // Replace returns a copy of the string s with the first n
361
+ // non-overlapping instances of old replaced by new.
362
+ // If old is empty, it matches at the beginning of the string
363
+ // and after each UTF-8 sequence, yielding up to k+1 replacements
364
+ // for a k-rune string.
365
+ // If n < 0, there is no limit on the number of replacements.
366
+ func (s string) Replace(old, new string, n int) string
350
367
351
368
// ReplaceAll returns a copy of the string s with all
352
369
// non-overlapping instances of old replaced by new.
0 commit comments