Add str remove duplicate lines tool

This commit is contained in:
Illya Marchenko 2023-12-04 10:35:34 +02:00
parent f24c6e330c
commit 77780ec130
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F
3 changed files with 47 additions and 0 deletions

@ -32,6 +32,7 @@ export default {
'fix_ru_en_keyboard': 'Fix ru-en keyboard', 'fix_ru_en_keyboard': 'Fix ru-en keyboard',
'str_length': 'Str length', 'str_length': 'Str length',
'str_to_lower_upper': 'Str to lower/upper', 'str_to_lower_upper': 'Str to lower/upper',
'str_remove_duplicate_lines': 'Str remove duplicate lines',
}, },
'SQL': { 'SQL': {
'sql_split_in': 'SQL split IN', 'sql_split_in': 'SQL split IN',

@ -25,6 +25,11 @@ const router = createRouter({
name: 'str_to_lower_upper', name: 'str_to_lower_upper',
component: () => import('../views/StrToLowerUppper.vue'), 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', path: '/fix_ru_en_keyboard',
name: 'fix_ru_en_keyboard', name: 'fix_ru_en_keyboard',

@ -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>