Try the following function, which will remove all leading and trailing quotes from the string value
function stripQuotes(str) {
str = str.replace(/^\"*/, '');
str = str.replace(/\"*$/, '');
return str;
}
It can be used as
$.get(url, function(procedureResult) {
procedureResult = stripQuotes(procedureResult);
$("#procedureDescription").text(procedureResult);
});
source
share