teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

誤字修正

2017/01/16 02:21

投稿

tacsheaven
tacsheaven

スコア13707

answer CHANGED
@@ -1,10 +1,10 @@
1
1
  次のようにすれば数字部分だけを取り出すことができます。
2
-
2
+ ※チェックするコントロールを h で受けているとします
3
3
  ```csharp
4
4
  Regex regex = new Regex("Picture(1[0-9][0-9])");
5
- Match match = regex.match(h.Name);
5
+ Match match = regex.Match(h.Name);
6
- if( match.success ) {
6
+ if( match.Success ) {
7
- string index_num = match.groups[1];
7
+ string index_num = match.Groups[1];
8
8
  ...
9
9
  }
10
10
  ```