<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Windymelt</author_name>
  <author_url>https://blog.hatena.ne.jp/Windymelt/</author_url>
  <blog_title>Lambdaカクテル</blog_title>
  <blog_url>https://blog.3qe.us/</blog_url>
  <categories>
    <anon>技術</anon>
    <anon>scala</anon>
  </categories>
  <description>Scala 2.13以降では、文字列型Stringから各種の数値を得るためのメソッドが標準ライブラリに用意されており、これを使うことで簡単に文字列から数値を得られるようになっている。parseIntやtoIntと違ってエラーを起こさないので便利。 //&gt; using scala 2.13.12 val s = &quot;42&quot; s.toIntOption // =&gt; Some(42) s.toLongOption // =&gt; Some(42L) s.toShortOption // =&gt; Some(42) s.toByteOption // =&gt; Some(42) s.toDoubleOption /…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.3qe.us%2Fentry%2F2023%2F10%2F03%2F161712&quot; title=&quot;Scalaで文字列から数値を得るには.toIntOptionがオススメ - Lambdaカクテル&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>2023-10-03 16:17:12</published>
  <title>Scalaで文字列から数値を得るには.toIntOptionがオススメ</title>
  <type>rich</type>
  <url>https://blog.3qe.us/entry/2023/10/03/161712</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
