James Robertson
Posts: 29924
Nickname: jarober61
Registered: Jun, 2003
|
David Buck, Smalltalker at large
|
|
|
|
Teaser
|
Posted: Sep 3, 2004 2:46 PM
|
|
|
This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
|
Original Post: Teaser
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
|
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog
|
|
I have a string operation I want to do. I can write the brute force code to do it. But there's something in me that wants to find the tricky/elegant/terse/cool way of doing it, rather than the brute force loop. I haven't really come up with anything that even comes close to a "one liner" yet. Can you?
The problem is this. Parse camelCase, but with a twist. Given the string 'CamelCase' or 'camelCase', its pretty easy to break into a collection of two strings, containing 'camel' and 'Case'. The twist is to deal with runs of uppercase abbreviations as one word. Here's some examples and their output.
'TheNextBIGThing' --> #('The' 'Next' 'BIG' 'Thing')
'USAHockeyTeam' --> #('USA' 'HockeyTeam')
'riseOfAARP' --> #('rise' 'Of' 'AARP')
Read: Teaser
|
|