string output =3;#Paul, John;2;#Rajamanickam, Gowtham;
i want to remove the 3;# and 2;#
my output =Paul, John;Rajamanickam, Gowtham;
anyone help to remove the characters from the string using javascript.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Saroj Kumar SahuRank #1,766 · 849 reputationPosted May 7, 2015, 1:29 AM EDT
You can use 'replace' method in javascript.
Ex:
//Declare your string
var output = '3;#Paul, John;2;#Rajamanickam, Gowtham;';
//string to be replaced
var pattren = /[0-9];#/g;
//use replace method
var result = output.replace(pattren, '');
Hope this will help you.