in reply to How do i convert uppercase in a bracket.

$string = ucfirst lc $string; $string =~ tr/()//d;

Replies are listed 'Best First'.
Re^2: How do i convert uppercase in a bracket.
by Anonymous Monk on May 06, 2005 at 13:06 UTC
    Sorry i just read i posted the wrong thing. I wanted I_Need_Help instead how do i do that?
      $string =~ s/([a-z]+)/ucfirst(lc($1))/ieg;
      would give you 'I_Need_(Help)'
      I'm sure you can strip the brackets for yourself...

      as an aside, when posting code it should be inside <code></code> tags, I guess you had a character class in your original regex, which has been garbled by the perlmonk's own-brand markup.

      ---
      my name's not Keith, and I'm not reasonable.
        Thank you. It works.

      perldoc -f split, perldoc -f map, perldoc -f lcfirst, perldoc -f join.