/**
 * This function takes in farm data as a string and returns a list containing specific farm information.
 *
 * @param data A string containing all the farm data.
 * @param start_index The starting index of the desired range.
 * @param end_index The ending index of the desired range.
 * @return A list containing the specified farm data.
 *
 * Example:
 * yieldFarmData("Farm1 Farm2 Farm3 Farm4 Farm5", 6, 17) // ['Farm2', 'Farm3', 'Farm4']
 */
fun yieldFarmData(data: String, start_index: Int, end_index: Int): List<String> {

    // Remove any leading or trailing whitespace from the string
    val trimmedData = data.trim()

    // Split the string into a list of farm names
    val farmList = trimmedData.split(" ")

    // Extract the desired range of farm names using slicing
    val slicedFarmData = farmList.subList(start_index, end_index)

    // Return the sliced farm data
    return slicedFarmData
}
/**
 * This function takes in farm data as a string and returns a list containing specific farm information.
 *
 * @param data A string containing all the farm data.
 * @param start_index The starting index of the desired range.
 * @param end_index The ending index of the desired range.
 * @return A list containing the specified farm data.
 *
 * Example:
 * yieldFarmData("Farm1 Farm2 Farm3 Farm4 Farm5", 6, 17) // ['Farm2', 'Farm3', 'Farm4']
 */
fun yieldFarmData(data: String, start_index: Int, end_index: Int): List<String> {
/**
 * This function takes in farm data as a string and returns a list containing specific farm information.
 *
 * @param data A string containing all the farm data.
 * @param start_index The starting index of the desired range.
 * @param end_index The ending index of the desired range.
 * @return A list containing the specified farm data.
 *
 * Example:
 * yieldFarmData("Farm1 Farm2 Farm3 Farm4 Farm5", 6, 17) // ['Farm2', 'Farm3', 'Farm4']
 */
fun yieldFarmData(data: String, start_index: Int, end_index: Int): List<String> {

    // Remove any leading or trailing whitespace from the string
    val trimmedData = data.trim()

    // Split the string into a list of farm names
    val farmList = trimmedData.split(" ")

    // Extract the desired range of farm names using slicing
    val slicedFarmData = farmList.subList(start_index, end_index)

    // Return the sliced farm data
    return slicedFarmData
}