On Thu, Mar 11, 2010 at 8:36 PM, Travis Griggs <span dir="ltr"><<a href="mailto:travisgriggs@gmail.com">travisgriggs@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
(Preamble: I have lurked here without really paying attention much for a year+ now. I thought I'd try to reinvolve myself. The following discussions are some of my favorite/funnest).<br>
<br>
I was looking at someone's ruby/regex code. I could do the equivalent of what they were doing with the ST Regex library. But I was curious if it could be done tersely/elegantly without using regex. Here's the challenge.<br>
<br>
Given strings of the form<br>
<br>
'This is a (string) with some (parenthetical fields)'<br>
<br>
turn them into<br>
<br>
'This is a (STRING) with some (PARENTHETICAL FIELDS)'<br></blockquote><div><br></div><div>In one line: </div><div><br></div><div>'This is a (string) with some (parenthetical fields)' withParentheticalFieldsCapitalized</div>
<div><br></div><div>...and then in the implementation of #withParentheticalFieldsCapitalized, take all the space you need to make it nicely readable and fast.</div><div><br></div><div>;)</div><div><br></div><div>- Stephen</div>
<div><br></div></div>