/**
 * This exercise tests your knowledge of concatenation and if statements.
 *
 * Given a condition, you need to concatenate two strings together or return one of the strings based on the condition.
 *
 * Write a Kotlin function called 'concatenateStringsIf' that takes in three arguments:
 *
 * - condition: A boolean value representing the condition to check.
 * - string1: A string.
 * - string2: Another string.
 *
 * Your task is to:
 *
 * - If the condition is true, concatenate string1 and string2 together and return the result.
 * - If the condition is false, return string1 as it is.
 *
 * You need to write the code that implements the above logic and return the final result.
 *
 * Example:
 * concatenateStringsIf(true, "Hello ", "world") -> "Hello world"
 * concatenateStringsIf(false, "Hello ", "world") -> "Hello "
 */
fun concatenateStringsIf(condition: Boolean, string1: String, string2: String): String {

    return if (condition) {
        string1 + string2
    } else {
        string1
    }
}
/**
 * This exercise tests your knowledge of concatenation and if statements.
 *
 * Given a condition, you need to concatenate two strings together or return one of the strings based on the condition.
 *
 * Write a Kotlin function called 'concatenateStringsIf' that takes in three arguments:
 *
 * - condition: A boolean value representing the condition to check.
 * - string1: A string.
 * - string2: Another string.
 *
 * Your task is to:
 *
 * - If the condition is true, concatenate string1 and string2 together and return the result.
 * - If the condition is false, return string1 as it is.
 *
 * You need to write the code that implements the above logic and return the final result.
 *
 * Example:
 * concatenateStringsIf(true, "Hello ", "world") -> "Hello world"
 * concatenateStringsIf(false, "Hello ", "world") -> "Hello "
 */
fun concatenateStringsIf(condition: Boolean, string1: String, string2: String): String {
/**
 * This exercise tests your knowledge of concatenation and if statements.
 *
 * Given a condition, you need to concatenate two strings together or return one of the strings based on the condition.
 *
 * Write a Kotlin function called 'concatenateStringsIf' that takes in three arguments:
 *
 * - condition: A boolean value representing the condition to check.
 * - string1: A string.
 * - string2: Another string.
 *
 * Your task is to:
 *
 * - If the condition is true, concatenate string1 and string2 together and return the result.
 * - If the condition is false, return string1 as it is.
 *
 * You need to write the code that implements the above logic and return the final result.
 *
 * Example:
 * concatenateStringsIf(true, "Hello ", "world") -> "Hello world"
 * concatenateStringsIf(false, "Hello ", "world") -> "Hello "
 */
fun concatenateStringsIf(condition: Boolean, string1: String, string2: String): String {

    return if (condition) {
        string1 + string2
    } else {
        string1
    }
}