<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>deloreanmc12</author_name>
  <author_url>https://blog.hatena.ne.jp/deloreanmc12/</author_url>
  <blog_title>3流プログラマのメモ書き</blog_title>
  <blog_url>https://3ryupg.hatenablog.com/</blog_url>
  <categories>
    <anon>Webがらみ</anon>
  </categories>
  <description>.NetやJavaだと文字列の前後の空白を取り除くための trim メソッドがあるんですが、JavaScriptにはどうやら無いようです。 JavaScriptライブラリの jQuery を使うと、trim が使えるようですね。 こんな感じです。 $.trim(&quot; ほげ &quot;); 半角、全角、タブ、改行が削除の対象となるようです。 JavaScirptだけでtrimをしようとすると、下記のようにすればいいようです。 function trim(str) { return str.replace(/^[ \t\r\n]+|[ \t\r\n]+$/g, &quot;&quot;); } 参考： jQuery 開発者向け…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2F3ryupg.hatenablog.com%2Fentry%2F2012%2F11%2F07%2F000200&quot; title=&quot;(JavaScript)jQueryを使って文字列の前後の空白を削除 - 3流プログラマのメモ書き&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>2012-11-07 00:02:00</published>
  <title>(JavaScript)jQueryを使って文字列の前後の空白を削除</title>
  <type>rich</type>
  <url>https://3ryupg.hatenablog.com/entry/2012/11/07/000200</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
