Using search and replace to rename a method

5 Dec 2011

It's easy to rename a method using Aba Search and Replace:

Replace GetFileSize with GetSize, addslashes with sqlite_escape_string.

The name of a method, GetFileSize, collided with the name of a Win32 API function, so I wanted to replace it with GetSize. The later is also shorter and avoids the tautology: file.GetFileSize.

To find the references to my method, not to the Win32 API function, I added a dot (and -> in C++): .GetFileSize

In a PHP code, I replaced all calls to addslashes with sqlite_escape_string when porting my site to SQLite. The two functions escape quotes differently; addslashes should never be used in SQLite.

Aba Search and Replace screenshot

Stop pasting your data into dubious cloud-based tools. Aba Search and Replace is your Swiss army knife for regular expression search, fast and safe updates across multiple files, and various conversions, with all your data staying on your computer. Built for power users, developers, testers, and analysts.

This is a blog about Aba Search and Replace, a tool for replacing text in multiple files.