Ask a question to get started
Enter to send•Shift+Enter new line
Edit a file by replacing string occurrences.
edit( self, file_path: str, old_string: str, new_string: str, replace_all: bool = False ) -> EditResult
file_path
str
Path to the file to edit.
old_string
The text to search for and replace.
new_string
The replacement text.
replace_all
bool
False
If True, replace all occurrences. If False (default), replace only if exactly one occurrence exists.
True