MathGroup Archive 2012

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

Search the Archive

Partition string into length n chunks


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.



  • Prev by Date: Re: Total least squares with Mathematica?
  • Next by Date: Coefficient
  • Previous by thread: Re: Partition Help
  • Next by thread: Re: Partition string into length n chunks