A

Admin • 828.03K Points
Coach

Q. How do you repeat a string 3 times in Kotlin?

  • (A) "Kotlin" * 3
  • (B) repeat("Kotlin", 3)
  • (C) repeat(3) { "Kotlin" }
  • (D) "Kotlin".repeat(3)
  • Correct Answer - Option(D)
  • Views: 4
  • Filed under category Kotlin
  • Hashtags:

Explanation by: Admin
repeat(n) is a string function that repeats a string n times.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.