String replacing error


#1

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


#2

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


#3

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


#4

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