Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | shifitzel |
How do you find and replace in GD Script?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | shifitzel |
How do you find and replace in GD Script?
Reply From: | Calinou |
Use the String.find()
and String.replace()
methods for this purpose. To only check whether a substring is present in a string, use the in
operator (e.g. if "hello" in "hello world"
will evaluate to true
).
Reply From: | Ninfur |
Just in-case you mean how to find and replace text in in Godot’s built in text editor:
Ctrl-R - Replace in current file
Ctrl-Shift-F → Replace… - Replace in multiple files
Why they didn’t follow the convention?
CTRL+F and CTRL+H for replace
Is that configurable?
Yes.
While editing a project, in the top left corner of the Godot Editor, go to:
Editor → Editor Settings → Shortcuts
You can click on “Listening for input…” and do ctrl+R to show the binding.