-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathduplicate-line.html
More file actions
73 lines (61 loc) · 1.51 KB
/
Copy pathduplicate-line.html
File metadata and controls
73 lines (61 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<title>Remove Duplicate Lines Tool</title>
<link rel="icon" href="favicon.png">
<style>
body {
font-family: Arial, sans-serif;
background: #f0f8ff;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
h2 {
color: #007bff;
text-align: center;
}
#textBox {
width: 90%;
max-width: 500px;
min-height: 150px;
padding: 10px;
font-size: 16px;
border-radius: 8px;
border: 1px solid #ccc;
background: #fff;
margin-bottom: 15px;
outline: none;
overflow-y: auto;
white-space: pre-wrap;
}
button {
padding: 10px 20px;
font-size: 16px;
border: none;
background-color: #007bff;
color: white;
border-radius: 8px;
cursor: pointer;
margin-bottom: 15px;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<h2>Remove Duplicate Lines</h2>
<div id="textBox" contenteditable="true" placeholder="Paste or type lines here..."></div>
<button onclick="removeDuplicates()">Remove Duplicates</button>
<script>
function removeDuplicates() {
var content = document.getElementById("textBox").innerText;
var lines = content.split('\n');
var uniqueLines = [...new Set(lines.map(line => line.trim()))].filter(line => line !== "");
document.getElementById("textBox").innerText = uniqueLines.join('\n');
}
</script>
</body>
</html>