Currying string proccessor

Report a typo

Create a function called stringProcessor(). This function will be curried and should accept three strings - a prefix, a main string, and a suffix. It should return a string that results from the concatenation of the prefix string, main string, and suffix string. However, each string should be processed before concatenation: the prefix should be converted to uppercase, the main string should remain unchanged, and the suffix should be in lowercase.

For instance, using the defined stringProcessor() function, the operation of prefixing "Hello" with "greet: ", and suffixing with ", WELCOME aboard!" should be done as follows:

val result = stringProcessor("greet: ")("Hello")(", WELCOME aboard!") // returns "GREET: Hello, welcome aboard!"

Sample Input 1:

greet:
 Hello
, WELCOME abroad!

Sample Output 1:

GREET: Hello, welcome abroad!
Write a program in Kotlin
//write your code here

Create a free account to access the full topic