]> git.ardis.lu - sheets-db/commitdiff
Correct replace to replaceAll
authorArdis Lu <ardisglu@gmail.com>
Sat, 25 Dec 2021 07:29:01 +0000 (23:29 -0800)
committerArdis Lu <ardisglu@gmail.com>
Sat, 25 Dec 2021 07:29:01 +0000 (23:29 -0800)
replace will only replace the first value.

Code.gs

diff --git a/Code.gs b/Code.gs
index 22e5706ebf4ffe297e8cc7ea7733405bf3bd9d85..14dbbf83d7d8e6a7c89953c0ae8ed52295ae1858 100644 (file)
--- a/Code.gs
+++ b/Code.gs
@@ -77,7 +77,7 @@ function generateDatabaseQuery() {
               values += `'${data.toISOString()}',`;
             }
             else {
-              values += `'${data.replace(/'/g, "''")}',`; // Escape apostrophe with double apostrophe
+              values += `'${data.replaceAll(/'/g, "''")}',`; // Escape apostrophe with double apostrophe
             }
             break;
           case 'NULL':
This page took 0.035441 seconds and 4 git commands to generate.