I used the following code to successfully split a string on underscore and capitalize the first letter of each word so obtained.
$c = 'a_c_code'; print join " ", map { ucfirst } split /_/, $c;
Was wondering if there is a one line regex to do this. I tried but could not come up with one, if there is no underscore character in the string.
Thanks all
--
arc_of_descent
In reply to split and capitalize regex by arc_of_descent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |