<?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>.Net開発</anon>
  </categories>
  <description>下記のように文字列型で数値をいれているケースが有るとします。 string no = &quot;1234&quot;; これを7桁にし、先頭に0で埋めたいというケースの場合、String.PadLeft メソッドを使えばいいようです。 string no = &quot;1234&quot;; no = no.PadLeft(7,'0'); こうすると、0001234 という文字列になります。 ちなみに、数値型を0埋め文字列にしたい場合は、String.Formatが使えますね。 int num = 123; string str = String.Format(&quot;{0:0000}&quot;, num); 参考： 指定の文字数になるまで先…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2F3ryupg.hatenablog.com%2Fentry%2F2012%2F05%2F16%2F003200&quot; title=&quot;(.Net)文字列で桁を揃えるため0埋めしたい - 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-05-16 00:32:00</published>
  <title>(.Net)文字列で桁を揃えるため0埋めしたい</title>
  <type>rich</type>
  <url>https://3ryupg.hatenablog.com/entry/2012/05/16/003200</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
