How to remove double quotes from default string in javascript/Jquery

remove first and last double quotes javascript
javascript remove quotes from beginning and end of string
remove double quotes "[]" from array javascript
remove double quotes from string
remove double quotes from json array javascript
remove first and last double quotes from string c#
remove single quotes from string javascript
how to remove double quote from string in js

I have one string

"{'name':'xyz'}","{'name':'PQR'}"

I need to remove double quotes it should be

{'name':'xyz'},{'name':'PQR'}

I am able to remove double quotes but end result is always like below format

"{'name':'xyz'},{'name':'PQR'}"

i want end result should be just

{'name':'xyz'},{'name':'PQR'}

Ideas are helpful

Using below code you can remove double quotes from a string:

var test = "\"House\"";
alert(test);
alert(test.replace(/\"/g, ""));

Javascript, How to remove quotation marks (double quotes) from string using jQuery or Javascript? I am working on a web-application which returns JSON� I have done it alert also shows proper formatted string but when i tried to assign it to any attribute it shows me "{'name':'xyz'},{'name':'PQR'}" with double quotes – Ashwinik Feb 17 '15 at 8:46 When you assign it to attribute then it consider as a string.

It is solved by converting current object to string and then used eval function,Worked solved thanks.

var eventlist = JSON.stringify(eventresult.d);//Jsonresult

var eventstring = new String();

eventstring = eventlist.toString().replace(/"/g, "");

eval(eventstring );

jQuery Replace Single or Double Quotes, Free JavaScript Book! replace function that takes two parameters. First the global search for all quotes (either single or double) and then a blank space to replace them (change the second parameter if you wish to replace them with something else – this code just removes them). Default javascript replace method will replace the first occurrence of the single quote, to replace all the occurrences we have to use regular expression. Removing all the single quotes from a string. var outputstr= inputstring.replace (/'/g,''); Replacing all the single quotes with double quote in a string.

Though you may resolved the issue, but question is about string you are retrieving.

its not JSON object in stringified format. You says its comes from $.post then it should not be

{'name':'xyz'}","{'name':'PQR'}

Its not json string representation of any JS object.

When you try to assign this one in any variable in post call it will assign only first string to varibale:

var a = {'name':'xyz'}","{'name':'PQR'}

See the result.

So first questing is is it valid string. Valid String representation of JS object could be : array of two object

"[{'name':'xyz'}","{'name':'PQR'}]"

Then just parse this string version of json object to get back JS object where

JSON.parse(your string representation retrieved from server)

Remove double quotes froma string, How do i remove the double quotes from this string and convert that value to JS date? var NonQuotesVaraible = new String(DateString); var temp = Number(NonQuotesVaraible ); DateString. replace(/"/g, ""); DateString. replace(/["]/g, ""); DateString. Simple jQuery code snippets to replace single quotes and replace double quotes using the jQuery.replace function that takes two parameters. First the global search for all quotes (either single or

Do the Following to achieve it,

1) put ur JSON.stringfy value in a VARIABLE,

e.g, var strLink = JSON.stringify(offerObj[i].language[countData].cta);

2) Now put the VARIABLE in JSON.parse

e.g, JSON.parse(strLink);

How do we remove quotes "" out of a string??, Hello Everyone, I am tired of looking for an answer to remove quotes out of a did some string operations of split and concatenation and now; value UTC. apply(a,a) // UTC date; d= new Date(u) // back to a JavaScript date. I need to remove double quotes ( " ) from starting and ending position of the string to showing slide show on page. Is there any way to do this. $(document).ready(function () {

remove double quotes from string in javascript Code Example, Javascript queries related to “remove double quotes from string in javascript” add an element to an array javascript � add and remove class in jquery (default- compile) on project electronicbookshop: Compilation failure� We can remove double quotes from string by using JSON.parse () or eval () or replace double quotes from JSON returned string in jQuery.

Need to remove double quotes from string in javascript, I have to pass it as array and thats creating a problem. I need to remove double quotes ( " ) from starting and ending position of the string to� Strip double quotes of beginning and end of string betheball I need a function that will look at a string and remove a double quote if it is the first character and if it is the last.

jQuery Remove Double Quotes from JSON Returned String in Ajax , We can remove double quotes from string by using JSON.parse() or and many articles relating to AngularJS, jQuery, JavaScript and asp.net. string.replace(/\"/g,'\\"') will escape all quotes. You could probably do both at once (just off the top of my head and not tested) string.replace(/([\"\'])/g,'\\'+$1)

Comments
  • are you trying to covert it into JSON object?
  • Is your JSON object in double quotes ?
  • I didn't have json object,it is just a string from $.post and it in double quotes
  • Where does the string come from? Why does it have quotes in the first place? Also, if you plan on using it as JSON then you also need to replace the single quotes with double quotes.
  • @ Sverri M. Olsen string come from server side,I have needed it in above format so i didn't remove single quotes.but finally i solved by below solution.
  • I have done it alert also shows proper formatted string but when i tried to assign it to any attribute it shows me "{'name':'xyz'},{'name':'PQR'}" with double quotes
  • When you assign it to attribute then it consider as a string.
  • Right so is there any solution for this.?
  • use eval() function may be useful for you.
  • it only remove inside object string not remove outside object string our string is :"{"status":0,"msg":"No record found!"}"?