<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xoyip</author_name>
  <author_url>https://blog.hatena.ne.jp/xoyip/</author_url>
  <blog_title>ぴよログ</blog_title>
  <blog_url>https://xoyip.hatenablog.com/</blog_url>
  <categories>
    <anon>Swift</anon>
  </categories>
  <description>例えば&quot;hogefugapiyo&quot;という文字列があるとして、これを4文字ずつに分割するなら[&quot;hoge&quot;, &quot;fuga&quot;, &quot;piyo&quot;]、5文字ずつに分割するなら[&quot;hogef&quot;, &quot;ugapi&quot;, &quot;yo&quot;]を得たい。 Rubyであればscanメソッドを使って次のように実行できるということがわかった。 str = &quot;hogefugapiyo&quot; # =&gt; &quot;hogefugapiyo&quot; str.scan(/.{1,5}/) # =&gt; [&quot;hogef&quot;, &quot;ugapi&quot;, &quot;yo&quot;] 参考 Ruby 文字列を任意の文字数に分割する - Qiita これと同じことをSwiftでやりたくなったが、ど…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxoyip.hatenablog.com%2Fentry%2F2015%2F08%2F10%2F132744&quot; title=&quot;SwiftでN文字ずつに分割した文字列を得る方法 - ぴよログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://ecx.images-amazon.com/images/I/41-FrdK0A2L.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-08-10 13:27:44</published>
  <title>SwiftでN文字ずつに分割した文字列を得る方法</title>
  <type>rich</type>
  <url>https://xoyip.hatenablog.com/entry/2015/08/10/132744</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
