From: Joel Pearson Date: 2013-04-20T19:34:47+09:00 Subject: Re: Input: sentence Modify: words Output: modified sentence tamouse mailing lists wrote in post #1106350: > On Fri, Apr 19, 2013 at 1:36 PM, Joel Pearson > wrote: >> s[/^[^A-Z]*[A-Z]/i] + ( letters.length - 2 ).to_s + >> s[/[A-Z][^A-Z]*$/i] >> end >> }.join(' ') > > Curious how you'd handle contractions :) "don't" should be d2t according to my logic, as I'm only counting letters. It depends what your real-life usage would be, but I decided to deal with numbers, letters, and punctuation separately. -- Posted via http://www.ruby-forum.com/.