回答編集履歴

1

追記

2022/09/13 16:24

投稿

退会済みユーザー
test CHANGED
@@ -5,3 +5,12 @@
5
5
  textArea.value = filteredLines.join('\n');
6
6
  ```
7
7
  - サンプル 👉 https://codepen.io/su507/pen/eYrdXqv?editors=1010
8
+
9
+ または正規表現による一発replaceで片付ける場合は
10
+ ```javascript
11
+ const textArea = document.querySelector('#txt');
12
+ textArea.value = textArea.value.replace(/[^\n]*abc[^\n]*\n/g, m => '');
13
+ ```
14
+ とかですかね。
15
+
16
+ - サンプル 👉 https://codepen.io/su507/pen/gOzwyKp?editors=1010