Google apps script 如何用应用程序脚本查找和替换字符?
我想找到这个角色的每一个实例(例如)™) 在一个名为“SF”的特定Google工作表中,将其从工作表中删除 到目前为止,我能够将其从该表中的特定范围(即J:J)中移除,但希望该范围为(a:AT) 请告知我的函数在处理某个范围时的错误位置Google apps script 如何用应用程序脚本查找和替换字符?,google-apps-script,google-sheets,Google Apps Script,Google Sheets,我想找到这个角色的每一个实例(例如)™) 在一个名为“SF”的特定Google工作表中,将其从工作表中删除 到目前为止,我能够将其从该表中的特定范围(即J:J)中移除,但希望该范围为(a:AT) 请告知我的函数在处理某个范围时的错误位置 函数CleanInputs(){ var sf=SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“sf”); var范围=sf.getRange(“J:J”); //查找并替换Screamingfrog
函数CleanInputs(){
var sf=SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“sf”);
var范围=sf.getRange(“J:J”);
//查找并替换Screamingfrog中的字符编码问题
range.setValues(range.getValues().map)函数(行){
返回[行[0]。替换(/行)™/, "")];
}));
}
使用和:
function myFunction() {
const sheetName = "SF";
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sh = ss.getSheetByName(sheetName);
sh.createTextFinder("’").replaceAllWith("");
}