String name = "abcdef"; name.Length; // 6
String name = "abcdef"; name = name.Substring (name.Length - 2, 2); // ef
if (a.IndexOf("検索文字列") == -1) { // no hit } else { // hit }