A

Admin • 802.91K Points
Coach

Q. What does the `String::from("hello")` function do?

  • (A) Returns a static string
  • (B) Creates a new `&str`
  • (C) Creates a heap-allocated `String`
  • (D) Returns a `char`
  • Correct Answer - Option(C)
  • Views: 5
  • Filed under category Rust
  • Hashtags:

Explanation by: Admin
`String::from()` creates a growable heap-allocated string.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.