#43 Allow separator to be specified for array makeString()

v3.2.0
closed
Rick McGuire
Classes (154)
5
2012-08-14
2005-02-17
Rick McGuire
No

The array makeString method allows either concatenates
the items together or separates them with linend
sequences. The linend sequences are not very portable,
since the sequence varies with the platform. It would
be useful if a separator character could be specified also:

say .array~makestring('S', ',') -- create a CVS string

Discussion

  • TheDavidFactor
    TheDavidFactor
    2007-10-03

    Logged In: YES
    user_id=1011368
    Originator: NO

    is there a compelling reason to limit this to a single character?

    Consider this:

    say '"'.array~makestring('S', '","')'"' -- create a CVS string

     
  • Rick McGuire
    Rick McGuire
    2007-10-03

    Logged In: YES
    user_id=1125291
    Originator: YES

    I don't believe there was anything in here that implied it had to be one character. In fact, the ability to specify explicitly a CRLF sequence implies that arbitrary string sequences be allowed.

     
  • Rick McGuire
    Rick McGuire
    2007-10-05

    Logged In: YES
    user_id=1125291
    Originator: YES

    Enhancement contribute by David Ruggles. Thank you David, nice job.

    Committed revision 870. Code changes. Doc changes still need to be done.

     
  • Rick McGuire
    Rick McGuire
    2007-10-06

    Logged In: YES
    user_id=1125291
    Originator: YES

    Committed revision 880. Doc update.

     


Anonymous


Cancel   Add attachments