エゼキエル書 33章11節

BIBLE(新改訳聖書、KJV)

エゼキエル書
33:11 彼らにこう言え。『わたしは誓って言う。──神である主の御告げ──わたしは決して悪者の死を喜ばない。かえって、悪者がその態度を悔い改めて、生きることを喜ぶ。悔い改めよ。悪の道から立ち返れ。イスラエルの家よ。なぜ、あなたがたは死のうとするのか。』

【KJV】 33:11 Say unto them, As I live, saith the Lord GOD, I have no pleasure in the death of the wicked; but that the wicked turn from his way and live: turn ye, turn ye from your evil ways; for why will ye die, O house of Israel?

Substringにて、任意の位置から指定した文字数分の文字列を取出す。

1. 名前空間

using System;
using System.Windows.Forms;

2. コード

  string s1 = "Hello, World!";

  // 左端から 5 文字取り出す。
  this.TextBox1.Text = s1.Substring(0, 5);

  // 左 5 文字目から 2 文字取り出す。

  this.TextBox1.Text = s1.Substring(5, 2);

// 右端から 6 文字取り出す。

  this.TextBox1.Text = s1.Substring(s1.Length-6, 6);

■ 説明
Substringにて、任意の位置から指定した文字数分の文字列を取出す。

Substring は開始方向から文字列を取出します。