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

12548Re: [Clip] splitting a string on a character

Expand Messages
  • Alan
    Oct 3, 2004
    • 0 Attachment
      Don Passenger wrote:
      [ . . ]
      > Perl has a split function that does this type of thing, but I am not
      > finding the equivalent.

      Hugo has shared the equivalent:

      ^!SetListDelimiter :
      ^!SetArray



      <Perl_Only_Associated>

      my( @stuff ) = split( /:/, $SomeDataString ) ;

      But if your char also is a *Perl* meta char (for example, just such as
      the pipe or | char is) then such meta char need be escaped (\ escapes,
      makes so is interpreted as a literal), thus:

      my( @stuff ) = split( /\|/, $SomeDataString ) ;

      Perl split does use a character as a delimiter then all item(s) between
      delimiter(s) are split off so to speak (or, put into an array).

      </Perl_Only_Associated>


      Alan.
    • Show all 4 messages in this topic