Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Partition string into length n chunks

  • To: mathgroup at smc.vnet.net
  • Subject: [mg126544] Re: Partition string into length n chunks
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Fri, 18 May 2012 05:25:27 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jp2bvf$506$1@smc.vnet.net>

On 2012.05.17. 10:13, David G wrote:
> I am sure this is trivially simple, but how do I partition a string into non-overlapping length n chunks? The best I could come up with is chunk[s_, n_] := StringJoin[#]&  /@ Partition[Characters[s], n] but this seems overly long-winded.
>

This question has been answered here:

http://mathematica.stackexchange.com/questions/5644/partition-string-into-chunks

-- 
Szabolcs Horvát
Visit Mathematica.SE:  http://mathematica.stackexchange.com/



  • Prev by Date: export to .m using a cell command
  • Next by Date: Re: Partition string into length n chunks
  • Previous by thread: Re: Partition string into length n chunks
  • Next by thread: Re: Partition string into length n chunks