Skip to content

Commit

Permalink
Merge pull request #1805 from eje211/patch-1
Browse files Browse the repository at this point in the history
Updated first sentence of "parsing a string" in string.md
  • Loading branch information
marioidival authored Jan 22, 2024
2 parents a6bc33b + 5b307a5 commit 179256a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/conversion/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ fn main() {

## Parsing a String

One of the more common types to convert a string into is a number. The idiomatic
approach to this is to use the [`parse`] function and either to arrange for
type inference or to specify the type to parse using the 'turbofish' syntax.
Both alternatives are shown in the following example.
It's useful to convert strings into many types, but one of the more common string
operations is to convert them from string to number. The idiomatic approach to
this is to use the [`parse`] function and either to arrange for type inference or
to specify the type to parse using the 'turbofish' syntax. Both alternatives are
shown in the following example.

This will convert the string into the type specified as long as the [`FromStr`]
trait is implemented for that type. This is implemented for numerous types
Expand Down

0 comments on commit 179256a

Please sign in to comment.