@function to-string($list, $glue: '', $is-nested: false) {
	$result: null;

	@for $i from 1 through length($list) {
		$e: nth($list, $i);

		@if type-of($e) == list {
			$result: $result#{to-string($e, $glue, true)};
		}

		@else {
			$result: if($i != length($list) or $is-nested, $result#{$e}#{$glue}, $result#{$e});
		}
	}

	@return $result;
}


@function str-replace($string, $search, $replace: '') {
	$index: str-index($string, $search);

	@if $index {
		@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
	}

	@return $string;
}

@function str-explode($string, $dem) {
	$list: ();
	$sum: str-length($string);

	@for $i from 1 through $sum {
		$str: str-index($string, $dem);
		@if str-length($string) >= 1 and $str == null {
			$list: append($list,$string);
			$string: '';
		}

		@if type-of($str) == number {
			$each: str-slice($string,0,($str - 1));
			$list: append($list, $each);
			$string: str-slice($string,($str + 1), $sum);
		}
	}

	@return $list;
}

@function to-list($value) {
	@return if(type-of($value) != list, ($value,), $value);
}


@function str-camelcase($value) {
	$words: str-explode($value, " ");
	$list: ();
	$return: "";
	@for $i from 1 through length($words) {
		$word: nth($words, $i);
		@if $i > 1 {
			$word: to-upper-case(str-slice($word, 1, 1)) + str-slice($word, 2, str-length($word));
		}
		$return: $return + $word;
	}
	@return $return;
}
