Remove Last Comma from String in Vue.js

There are the Following The simple About Vue js Remove Last Comma from String Full Information With Example and source code.

As I will cover this Post with live Working example to develop VueJS Remove Item From Comma Separated string, so the some major files and Directory structures for this example is following below.


Deleting Array index in Vue.js


This is where I will make a simple HTML form and PHP server side source code for our web application. To make the forms simply all souce code copy and write it into your any text editor Like Notepad++, then save file it as index.html.


var vue_str = $.trim($('.txtValue').val());
var lastChar = vue_str.slice(-1);
if (lastChar == ',') {
vue_str = vue_str.slice(0, -1);
<!DOCTYPE html>
<meta name="description" content="Vue.delete">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Vue.js Remove Last Comma from String</title>
<script src=""></script>
new Vue({
el: '#app',
data: {
devlopers: ['Jaydeep', 'Krunal', 'Ankit', 'Dhaval']
methods: {
remove_array_index (index) {
// this.devlopers.splice(index, 1)
this.$delete(this.devlopers, index)

<div id="app">
<li v-for="dev, index in devlopers">
<button @click="remove_array_index(index)">×</button>

Example Vue Remove Last Comma from a string

Vue JS Remove Last Comma from a string

vue_str = vue_str.replace(/,\s*$/, "");

My Paka Knowledgeable Ideas, Tips and Tricks, Useful Content, Jobs, Technology, Earn Money, gmail creation, skype, yahoo and more useful things.

I hope you get an idea about Vue.js Remove Last Char from String.

#vue #vuejs 

Remove Last Comma from String in Vue.js
1.55 GEEK