Skip to content

Instantly share code, notes, and snippets.

@davidkpiano
Created February 9, 2015 18:26
Show Gist options
  • Save davidkpiano/ac394c4e95eb1af59382 to your computer and use it in GitHub Desktop.
Save davidkpiano/ac394c4e95eb1af59382 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
@function without-first-letter($string) {
$uppercase-chars: A B C D E F G;
$result: '';
@for $index from 2 through str-length($string) {
$result: $result + nth($uppercase-chars, $index);
}
@return $result;
}
.test {
input: 'without-first-letter(abcd)';
output: without-first-letter(abcd);
input: 'without-first-letter(a)';
output: without-first-letter(a); // expected '';
foo: str-length("");
}
.test {
input: 'without-first-letter(abcd)';
output: "BCD";
input: 'without-first-letter(a)';
output: "BA";
foo: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment