Unknown model· unknown
from ShareGPT 90K (shared ChatGPT conversations)
Write a google appscript that will remove all text within bracket like this "[Example]"…
- User
Write a google appscript that will remove all text within bracket like this "[Example]" from a google docs document.
- Assistant
Here is a sample Google AppScript that you can use to remove all text within brackets from a Google Docs document:
codefunction removeTextInBrackets() { // Get the active Google Docs document var doc = DocumentApp.getActiveDocument(); // Get all the paragraphs in the document var paragraphs = doc.getBody().getParagraphs(); // Loop through each paragraph for (var i = 0; i < paragraphs.length; i++) { var paragraph = paragraphs[i]; // Get the text of the paragraph var text = paragraph.getText(); // Remove all text within brackets text = text.replace(/\[.*?\]/g, ""); // Set the new text of the paragraph paragraph.setText(text); } }To use this script, copy and paste the code into the script editor in your Google Docs document, then save and run the script. This will remove all text within brackets from the document.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.