I am looking for an alternative program on macOS, like Notepad++ with two abilities:
- To write and edit program code,
- Search specific string in a folder full of text files.
Sublime Text 3 is the editor you are looking for. It is available to download for free.
This text editor is pretty popular with software developers and users of macOS.
Sublime text includes powerful text editing features along with support for popular programming languages. It also lets you easily search within files in a folder.
P.S.: Sublime Text 3 may be downloaded and evaluated for free, however a license must be purchased for continued use. Acquiring a license by paying one time fee removes the non-intrusive prompt to register the product and it is meant to support the developer behind the wonderful product.
A couple points of note from the Sales FAQ page:
A license is valid for Sublime Text 3, and includes all point updates, as well as access to prior versions (e.g., Sublime Text 2). Future major versions, such as Sublime Text 4, will be a paid upgrade.
Licenses purchased for Sublime Text 3 do not expire, however an upgrade fee will be required for Sublime Text 4.
P.P.S.: I have no-affiliation whatsoever with the developer. This is a wonderful app which is widely popular among both casual users and software developers.