String replacing error

When i try to replace the string showing this error

below my code:"

export class HomePage {

	  qrData = null;
	  qrData2= null;
  	createdCode = null;
  	scannedCode = null;
	  data:any = {};

  constructor(public navCtrl: NavController) { = ''; = '';


    createCode() {
    this.createdCode = JSON.stringify(;
     let jsonString = this.createCode;
     jsonString = jsonString.replace(/("{|}")/gi,'"');


Please help me anyone

typo. jsonString becomes the function createCode, where you probably want createdCode

can you give me the example of code how to remove quotation from string

They just told you what the problem is of your code. Did fixing it work?

1 Like