Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] Is there a function similar to chop but effective on the start of a string?

Expand Messages
  • Shawn Corey
    ... Oops. I stand corrected. ... Granted. I still don t know why anyone would do this. chomp() was invented because chop() discarded characters without testing
    Message 1 of 8 , Oct 18, 2005
      Jeff 'japhy' Pinyan wrote:
      > I'll concede the ^ anchor to you, but you missed the part of my post where
      > I said the /s modifier allows . to match newline.

      Oops. I stand corrected.

      >
      > But still, a regex is overkill for something like this. We're not trying
      > to match a pattern, we're trying to remove the first character of a
      > string, and substr() is more appropriate here.

      Granted.

      I still don't know why anyone would do this. chomp() was invented
      because chop() discarded characters without testing them. Either this is
      a homework assignment or the OP is making dangerous assumptions.


      --- Shawn
    Your message has been successfully submitted and would be delivered to recipients shortly.