Created
March 15, 2011 09:37
-
-
Save spearson/870501 to your computer and use it in GitHub Desktop.
convert a string to a URL
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
String>>asUrl | |
^ String streamContents: [ :stream | | |
self do: [ :char | | |
char isSeparator ifTrue: [ stream nextPut: $- ]. | |
char isAlphaNumeric ifTrue: [ stream nextPut: char asLowercase ] ] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment