[flexcoders] Perplexing regex/replace() issue

2009-03-16 Thread jimmy5804
This seems simple, but I can't figure it out. I have some input I don't control with a lot of properties that look like "xx-yyy" that I want to camelcase: "xxYyy" and I'd like to do this with a one-line replace() instead of a longer split/join approach. I've tried several variations of: var

Re: [flexcoders] Perplexing regex/replace() issue

2009-03-16 Thread Beau Scott
Kinda cheated for one line but it works: var s:String = t.toLowerCase().replace(/-([a-z])/g, function():String { return arguments[1].toUpperCase();}); On Mon, Mar 16, 2009 at 11:44 AM, jimmy5804 wrote: > > This seems simple, but I can't figure it out. > > I have some input I don't control wi

Re: [flexcoders] Perplexing regex/replace() issue

2009-03-16 Thread Maciek Sakrejda
eply-to: flexcoders@yahoogroups.com To: flexcoders@yahoogroups.com Subject: [flexcoders] Perplexing regex/replace() issue Date: Mon, 16 Mar 2009 17:44:55 - put I don't control with a lot of properties that look like "xx-yyy" that I want to camelcase: "xxYyy" and I'd l