Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Mathematica - partition string into chunks?

I want to split a string in Mathematica into substrings of a given length so that, say, "ABCDEF" -> {"AB","CD","EF"}. I cannot think of a simple way to do this. Obviously I can write chunk[s_, n_] := StringJoin[#] & /@ Partition[Characters[s], n] but this seems unnecessarily long-winded. I'm sure there's an obvious and simple technique, but I can't spot it.

1 Answer

Relevance
Still have questions? Get your answers by asking now.