To bring our code closer to the natural language, Kotlin provides infix notations for the functions containing a single parameter. This way, we can invoke the function without using brackets. In this recipe, we are going to learn how to design an infix extension function for the String type, named concat(), which is responsible for the concatenation of two string values.
Infix notations for functions
Getting ready
In order to enable an infix notation for the function, we simply need to add the infix keyword before the function header.
How to do it...
Declare the concat...