Question - What is an infix function in Kotlin?
Answer -
An infix function is used to call the function without using any bracket or parenthesis. You need to use the infix keyword to use the infix function.
class Operations {
var x = 10;
infix fun minus(num: Int) {
this.x = this.x - num
}
}
fun main() {
val opr = Operations()
opr minus 8
print(opr.x)
}