def str_slice(string, start_at, end_at = nil)
      assert_type string, :String, :string
      assert_unit start_at, nil, "start-at"

      end_at = number(-1) if end_at.nil?
      assert_unit end_at, nil, "end-at"

      return Sass::Script::Value::String.new("", string.type) if end_at.value == 0
      s = start_at.value > 0 ? start_at.value - 1 : start_at.value
      e = end_at.value > 0 ? end_at.value - 1 : end_at.value
      s = string.value.length + s if s < 0
      s = 0 if s < 0
      e = string.value.length + e if e < 0
      return Sass::Script::Value::String.new("", string.type) if e < 0
      extracted = string.value.slice(s..e)
      Sass::Script::Value::String.new(extracted || "", string.type)
    end
def str_slice(string, start_at, end_at = nil)
      assert_type string, :String, :string
      assert_unit start_at, nil, "start-at"

      end_at = number(-1) if end_at.nil?
      assert_unit end_at, nil, "end-at"

      return Sass::Script::Value::String.new("", string.type) if end_at.value == 0
      s = start_at.value > 0 ? start_at.value - 1 : start_at.value
      e = end_at.value > 0 ? end_at.value - 1 : end_at.value
      s = string.value.length + s if s < 0
      s = 0 if s < 0
      e = string.value.length + e if e < 0
      return Sass::Script::Value::String.new("", string.type) if e < 0
      extracted = string.value.slice(s..e)
      Sass::Script::Value::String.new(extracted || "", string.type)
    end
Extracts a substring from `$string`. The substring will begin at index
 `$start-at` and ends at index `$end-at`.

 Note that unlike some languages, the first character in a Sass string is
 number 1, the second number 2, and so forth.

 @example
  str-slice("abcd", 2, 3)   => "bc"
  str-slice("abcd", 2)      => "bcd"
  str-slice("abcd", -3, -2) => "bc"
  str-slice("abcd", 2, -2)  => "bc"

 @overload str_slice($string, $start-at, $end-at: -1)
   @param $start-at [Sass::Script::Value::Number] The index of the first
     character of the substring. If this is negative, it counts from the end
     of `$string`
   @param $end-at [Sass::Script::Value::Number] The index of the last
     character of the substring. If this is negative, it counts from the end
     of `$string`. Defaults to -1
   @return [Sass::Script::Value::String] The substring. This will be quoted
     if and only if `$string` was quoted
 @raise [ArgumentError] if any parameter is the wrong type