/**
 * Given a string and start and stop parameters, return a subset of the string using string slicing.
 *
 * @param string The input string.
 * @param start The starting index of the subset (inclusive).
 * @param stop The ending index of the subset (exclusive).
 * @return A subset of the string using string slicing.
 *
 * Example:
 * createStringSubset("Hello, World!", 2, 8) -> "llo, W"
 * createStringSubset("Python", 1, 5) -> "ytho"
 */
fun createStringSubset(string: String, start: Int, stop: Int): String {

    // Check if start and stop parameters are within valid range
    if (start < 0 || stop > string.length || start >= stop) {
        return "Invalid range"
    }

    // Create the subset of the string using slicing
    val subset = string.substring(start, stop)

    return subset
}
/**
 * Given a string and start and stop parameters, return a subset of the string using string slicing.
 *
 * @param string The input string.
 * @param start The starting index of the subset (inclusive).
 * @param stop The ending index of the subset (exclusive).
 * @return A subset of the string using string slicing.
 *
 * Example:
 * createStringSubset("Hello, World!", 2, 8) -> "llo, W"
 * createStringSubset("Python", 1, 5) -> "ytho"
 */
fun createStringSubset(string: String, start: Int, stop: Int): String {
/**
 * Given a string and start and stop parameters, return a subset of the string using string slicing.
 *
 * @param string The input string.
 * @param start The starting index of the subset (inclusive).
 * @param stop The ending index of the subset (exclusive).
 * @return A subset of the string using string slicing.
 *
 * Example:
 * createStringSubset("Hello, World!", 2, 8) -> "llo, W"
 * createStringSubset("Python", 1, 5) -> "ytho"
 */
fun createStringSubset(string: String, start: Int, stop: Int): String {

    // Check if start and stop parameters are within valid range
    if (start < 0 || stop > string.length || start >= stop) {
        return "Invalid range"
    }

    // Create the subset of the string using slicing
    val subset = string.substring(start, stop)

    return subset
}