I need to remove the quotation marks from a string that I get in json, for this I am creating a pipe, but I am not able to remove the double quotes.
I tried something like:
@Pipe({
name: 'prettyprint'
})
export class PrettyPrintPipe implements PipeTransform {
transform(val) {
return JSON.stringify(val, null, 2)
.replace("\"", "")
.replace("{", "")
.replace("}", "");
}
}
Também tentei:
.replace('""', "")
But without success, the quotes do not go away.
Any ideas?