Skip to content

Instantly share code, notes, and snippets.

@spearson
Created March 15, 2011 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spearson/870501 to your computer and use it in GitHub Desktop.
Save spearson/870501 to your computer and use it in GitHub Desktop.
convert a string to a URL
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