Currying concatenation

Report a typo

Create a function named concatenate(), applying the principles of currying. This function should accept two string inputs and return a string as output - the result of concatenating the two inputs. Your task is to define and illustrate how to call this function in Kotlin, where the function call is divided into two calls, each with one of the arguments.

For instance, using the defined concatenate() function, the concatenation of "Hello, " and "World!" should be done as follows:

val result = concatenate("Hello, ")("World!") // returns "Hello, World!"

Sample Input 1:

Hello, 
World

Sample Output 1:

Hello, World
Write a program in Kotlin
//write your code here

Create a free account to access the full topic