Every line of 'remove quotes from string javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
28 function removeQuotes(string) { 29 if (typeof string === 'string' || string instanceof String) { 30 string = string.replace(/^['"]+|\s+|\\|(;\s?})+|['"]$/g, ''); 31 } 32 return string; 33 }
357 function removeQuotes(value) { 358 if (value.length > 1 && (value[0] === "'" || value[0] === '"')) { 359 return value.substr(1, value.length - 2); 360 } 361 return value; 362 }
106 function stripQuotes(str) { 107 if (str.length === 0) { 108 return str; 109 } 110 if (str.charAt(0) === "\"" && str.charAt(str.length - 1)) { 111 return str.substring(1, str.length - 1); 112 } 113 return str; 114 }
50 export function quotes(value:string):string { 51 return value.replace(/((?:[^\\']|\\.)+)|(')/g, function ($0, $1, $2) { 52 return $2 ? "\\'" : $1; 53 }); 54 }
9 export function escapeQuotes(value, defaultValue = '') { 10 return value ? value.replace(/(^|[^\\])"/g, '$1\\\"') : defaultValue; 11 }
43 function escapeSingleQuote (string) { 44 if (typeof string !== 'string') { 45 return string 46 } 47 return string.replace(/'/g, '\\\'') 48 }
205 function strip_quotes(s) { return s.slice(1, -1); }
51 export function escapeDoubleQuotes(string) { 52 return string.replace(/\"/g, '\\$&'); 53 }
1 export function escapeQuotes(input: string) { 2 // double escape quotes so that they are not unescaped completely in the template string 3 return input.replace(/"/g, '\\"'); 4 }
23 export function removeQuotesFromKeys (str) { 24 return str.replace(/"([^(")"]+)":/g,"$1:") 25 }