Created
December 24, 2014 12:40
-
-
Save Ms2ger/83d07a3df86707245b4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut result = "".into_string(); | |
let mut chars = remainder.chars(); | |
loop { | |
match chars.next() { | |
Some('-') => { | |
match chars.next() { | |
Some(c) if 'a' <= c && c <= 'z' => { | |
result.push(c.to_uppercase()); | |
}, | |
Some(c) => { | |
result.push('-'); | |
result.push(c); | |
}, | |
None => { | |
result.push('-'); | |
break; | |
}, | |
} | |
}, | |
Some(c) => { | |
result.push(c); | |
} | |
None => break, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment