/**
 * Given a string with format "<name>|<age>|<gender>", extract each piece of data and return as a triple.
 *
 * @param text String containing the data in the format "<name>|<age>|<gender>"
 * @return Triple with three elements: name, age, and gender.
 *
 * Example:
 * extractData("John|30|Male") -> Triple("John", "30", "Male")
 */
fun extractData(text: String): Triple<String, String, String> {

    val name = text.substringBefore("|")
    val remainingText = text.substringAfter("|")
    val age = remainingText.substringBefore("|")
    val gender = remainingText.substringAfter("|")

    return Triple(name, age, gender)
}
/**
 * Given a string with format "<name>|<age>|<gender>", extract each piece of data and return as a triple.
 *
 * @param text String containing the data in the format "<name>|<age>|<gender>"
 * @return Triple with three elements: name, age, and gender.
 *
 * Example:
 * extractData("John|30|Male") -> Triple("John", "30", "Male")
 */
fun extractData(text: String): Triple<String, String, String> {
/**
 * Given a string with format "<name>|<age>|<gender>", extract each piece of data and return as a triple.
 *
 * @param text String containing the data in the format "<name>|<age>|<gender>"
 * @return Triple with three elements: name, age, and gender.
 *
 * Example:
 * extractData("John|30|Male") -> Triple("John", "30", "Male")
 */
fun extractData(text: String): Triple<String, String, String> {

    val name = text.substringBefore("|")
    val remainingText = text.substringAfter("|")
    val age = remainingText.substringBefore("|")
    val gender = remainingText.substringAfter("|")

    return Triple(name, age, gender)
}