Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10128

Re: Partition string into length n chunks

From Szabolcs Horvát <szhorvat@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Partition string into length n chunks
Date 2012-05-18 09:27 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jp54lq$goj$1@smc.vnet.net> (permalink)
References <jp2bvf$506$1@smc.vnet.net>

Show all headers | View raw


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/

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Partition string into length n chunks David G <daggillies@gmail.com> - 2012-05-17 08:13 +0000
  Re: Partition string into length n chunks David Bailey <dave@removedbailey.co.uk> - 2012-05-18 09:24 +0000
  Re: Partition string into length n chunks Szabolcs Horvát <szhorvat@gmail.com> - 2012-05-18 09:27 +0000

csiph-web