Add str remove duplicate lines tool
This commit is contained in:
parent
f24c6e330c
commit
77780ec130
@ -32,6 +32,7 @@ export default {
|
||||
'fix_ru_en_keyboard': 'Fix ru-en keyboard',
|
||||
'str_length': 'Str length',
|
||||
'str_to_lower_upper': 'Str to lower/upper',
|
||||
'str_remove_duplicate_lines': 'Str remove duplicate lines',
|
||||
},
|
||||
'SQL': {
|
||||
'sql_split_in': 'SQL split IN',
|
||||
|
@ -25,6 +25,11 @@ const router = createRouter({
|
||||
name: 'str_to_lower_upper',
|
||||
component: () => import('../views/StrToLowerUppper.vue'),
|
||||
},
|
||||
{
|
||||
path: '/str_remove_duplicate_lines',
|
||||
name: 'str_remove_duplicate_lines',
|
||||
component: () => import('../views/StrRemoveDuplicateLines.vue'),
|
||||
},
|
||||
{
|
||||
path: '/fix_ru_en_keyboard',
|
||||
name: 'fix_ru_en_keyboard',
|
||||
|
41
src/views/StrRemoveDuplicateLines.vue
Normal file
41
src/views/StrRemoveDuplicateLines.vue
Normal file
@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<h2 class="tool-title">Str remove duplicate lines</h2>
|
||||
<hr class="mt-5 mb-5">
|
||||
|
||||
<div class="input-group">
|
||||
<label for="data">Data</label>
|
||||
<textarea id="data" v-model="toolData.data" style="height: 150px"></textarea>
|
||||
</div>
|
||||
|
||||
<hr class="mt-5 mb-5">
|
||||
|
||||
<div class="input-group">
|
||||
<label for="result">Result</label>
|
||||
<textarea id="result" v-model="toolResult" style="height: 150px"></textarea>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
function arrayUnique(value, index, array) {
|
||||
return array.indexOf(value) === index;
|
||||
}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
toolData: {
|
||||
data: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
toolResult() {
|
||||
return this.toolData.data.split('\n').filter(arrayUnique).join('\n');
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user