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

回答編集履歴

1

コメントを受けての追記

2017/12/18 13:20

投稿

otn
otn

スコア86365

answer CHANGED
@@ -1,3 +1,16 @@
1
1
  置換はプログラミング言語によって方法が異なりますので、言語を明示する必要があります。
2
2
  先の質問を見ると、C#ですかね。
3
- `text = text.Replace("//","");`
3
+ `text = text.Replace("//","");`
4
+
5
+ #追記
6
+ なるほど、読み取れてませんでした。
7
+ テストしてませんがこんな感じで。
8
+ ```C#
9
+ while(true){
10
+ work = Regex.Replace(text, "(\".+?)//(.+?\")", "$1$2");
11
+ if(work == text) {
12
+ break;
13
+ }
14
+ text = work;
15
+ }
16
+ ```