我有一個代碼,我希望代碼在活動表中找到符號“并將其替換為空格。我已經測驗了這個文本示例 - Tot 并且代碼作業正常。有沒有辦法在哪里使用代碼它在運行時將符號 " 替換為空格和 and 。在使用的代碼下方:
function searchAndReplace(searchTerm, replacement)
{textFinder = SpreadsheetApp.getActive().getSheetByName("Sheet1")
.createTextFinder("Tot")
.matchEntireCell(真)
.matchCase(真)
.matchFormulaText(假)
.ignore 變音符號(假)
.replaceAllWith(" "); }
uj5u.com熱心網友回復:
嘗試
function searchAndReplace() {
textFinder = SpreadsheetApp.getActive().getSheetByName("Sheet1")
.createTextFinder("\"")
.matchEntireCell(false)
.matchCase(true)
.matchFormulaText(false)
.ignoreDiacritics(false)
.replaceAllWith(" ");
}
uj5u.com熱心網友回復:
在這種情況下,它可以縮短為:
function searchAndReplace() {
SpreadsheetApp.getActive().getSheetByName('Sheet1').createTextFinder('"').replaceAllWith(' ');
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/466572.html
