Kotlin: infix notation
Example:
infix fun Int.times(str: String) = str.repeat(this)
Infix notation allows you to call a function without dot and parentheses.
Solution:
print(2 times "Bye ")
// Outputs: Bye Bye
Example: Solution:Kotlin: infix notation
Infix notation allows you to call a function without dot and parentheses.
infix fun Int.times(str: String) = str.repeat(this)
print(2 times "Bye ")
// Outputs: Bye Bye