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;
  	createdCode2:string;
  	scannedCode = null;
	  data:any = {};

 
  constructor(public navCtrl: NavController) {
  	this.data.qrData = '';
  	this.data.qrData2 = '';


  }

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

  }

Please help me anyone
Thanks

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