Answers for "how to remove quotes using regex"

0

how to remove quotes using regex

str.replace(/^"(.+(?="$))"$/, '$1');
Posted by: Guest on October-04-2021
0

how to remove quotes using regex

if (str.charAt(0) === '"' && str.charAt(str.length -1) === '"')
{
    console.log(str.substr(1,str.length -2));
}
Posted by: Guest on October-04-2021
0

how to remove quotes using regex

var someStr = 'He said "Hello, my name is Foo"';
console.log(someStr.replace(/['"]+/g, ''));
Posted by: Guest on October-04-2021
0

how to remove quotes using regex

str.replace(/^["'](.+(?=["']$))["']$/, '$1');
Posted by: Guest on October-04-2021
0

how to remove quotes using regex

var str = 'remove "foo" delimiting double quotes';
console.log(str.replace(/"([^"]+(?="))"/g, '$1'));
//logs remove foo delimiting quotes
str = 'remove only "foo" delimiting "';//note trailing " at the end
console.log(str.replace(/"([^"]+(?="))"/g, '$1'));
//logs remove only foo delimiting "<-- trailing double quote is not removed
Posted by: Guest on October-04-2021
0

how to remove quotes using regex

someStr.replace(/^"(.+)"$/,'$1');
Posted by: Guest on October-04-2021

Code answers related to "how to remove quotes using regex"

Code answers related to "Javascript"

Browse Popular Code Answers by Language