/**
 * Given a string, a start index, and an end index, slice the original string and return the sliced portion.
 *
 * @param string The string to slice.
 * @param start The start index of the slice.
 * @param end The end index of the slice.
 * @return The sliced portion of the string.
 */
fun sliceString(string: String, start: Int, end: Int): String {

    if (start >= end) {
        return ""
    }

    var startIndex = start
    if (start < 0) {
        startIndex = 0
    }

    var endIndex = end
    if (end > string.length) {
        endIndex = string.length
    }

    var slicedString = ""
    for (i in startIndex until endIndex) {
        slicedString += string[i]
    }

    return slicedString
}
/**
 * Given a string, a start index, and an end index, slice the original string and return the sliced portion.
 *
 * @param string The string to slice.
 * @param start The start index of the slice.
 * @param end The end index of the slice.
 * @return The sliced portion of the string.
 */
fun sliceString(string: String, start: Int, end: Int): String {
/**
 * Given a string, a start index, and an end index, slice the original string and return the sliced portion.
 *
 * @param string The string to slice.
 * @param start The start index of the slice.
 * @param end The end index of the slice.
 * @return The sliced portion of the string.
 */
fun sliceString(string: String, start: Int, end: Int): String {

    if (start >= end) {
        return ""
    }

    var startIndex = start
    if (start < 0) {
        startIndex = 0
    }

    var endIndex = end
    if (end > string.length) {
        endIndex = string.length
    }

    var slicedString = ""
    for (i in startIndex until endIndex) {
        slicedString += string[i]
    }

    return slicedString
}