View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Fall 2004 Final Exam Review: Squeak Code

stringToHex: aCollectionOfString
"Convert a collection of strings into a collection of hex"

collectionOfHex := OrderedCollection new.
(aCollectionOfString findTokens: ' ') do: [:aNum | collectionOfHex add: ((aNum asNumber) hex)].
^collectionOfHex.


stringToHex: aString
^((aString findTokens: ' ') collect: [:eachString | ((eachString asNumber) hex).]).


Link to this Page