<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ch3cooh393</author_name>
  <author_url>https://blog.hatena.ne.jp/ch3cooh393/</author_url>
  <blog_title>酢ろぐ！</blog_title>
  <blog_url>https://blog.ch3cooh.jp/</blog_url>
  <categories>
    <anon>開発</anon>
    <anon>開発-iOS</anon>
  </categories>
  <description>文字列を格納した配列があり、Swiftを使って特定の文字列が格納されているインデックスが知りたいことがあります。 let list = [ &quot;松平&quot;, &quot;上杉&quot;, &quot;木下&quot;, &quot;津田&quot;, &quot;島津&quot;, &quot;木下&quot;, &quot;尼子&quot; ] let foundItems = list.enumerated() .filter({ $0.element == &quot;木下&quot; }) .map({ $0.offset }) 2と5が返ってきます。 関連記事 同じ処理のC#+LINQ版はこちら。 LINQを使って特定の文字列が格納されているインデックスを取得する - 酢ろぐ！ このほかにもiOSアプリ開発で見つけたネタや悩…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.ch3cooh.jp%2Fentry%2Fios%2Fselect_index_from_array&quot; title=&quot;Swiftで特定の文字列が格納されているインデックスを取得する - 酢ろぐ！&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-06-26 08:53:39</published>
  <title>Swiftで特定の文字列が格納されているインデックスを取得する</title>
  <type>rich</type>
  <url>https://blog.ch3cooh.jp/entry/ios/select_index_from_array</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
