Find and replace Android studio

2019-03-07 13:27发布

Is there a way to find and replace all occurrences of a word in an entire project( not just a single class using refactor -> rename) and also maintain case, either in android studio or using a command line script?

For example, Supplier has to go to Merchant, supplier -> merchant, SUPPLIER -> MERCHANT. My boss wants me to change all instances of supplier with merchant for a project im working on. Ive been doing it for about an hour and i know im wasting my time. Let me know of any time saving suggestions.

9条回答
女痞
2楼-- · 2019-03-07 13:56

In Android studio, Edit -- > Find --> Replace in path, this will check in whole project including comments and code.

查看更多
We Are One
3楼-- · 2019-03-07 14:02

If you use refactor->rename for the name of the file, everywhere the file is used in your project the refactor will replace it.

I have already rename variables, xml file, java file, multiple drawable and after the operation I could build directly without error.

Do a back-up of your project and try to see if it work for you.

查看更多
甜甜的少女心
4楼-- · 2019-03-07 14:05

Press Ctrl+R to find and replace codes in the class where you are...

查看更多
登录 后发表回答