R

Ravina • 3.96K Points
Extraordinary

Q. Which method removes all elements from a Vec?

  • (A) clear()
  • (B) truncate(0)
  • (C) remove_all()
  • (D) drop()
  • Correct Answer - Option(A)
  • Views: 6
  • Filed under category Rust
  • Hashtags:

Explanation by: Ravina
clear() empties a vector in place.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.