As I will cover this Post with live Working example to develop remove last comma from string, so the some major files and Directory structures for this example is following below.
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 for
var devlopers = 'Jaydeep Gondaliya!'; var results = devlopers.slice(0, -1); alert(results);
var devlopers = 'Krunal sisodiya!'; var results = devlopers.slice(0, -1); alert(results);
var studentId = str.substring(0, str.length-1);
var studentId = '1,2,3,'; var results = studentId.substr(0, results.length-1); alert(results); // output: '1,2,3'
Delete first and last character
var studentId = '12345'; var results = studentId.substr(1, studentId.length-2); alert(results); // output: '234'
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.