I need your help, guys!

Is there any way to find only specific data and replace it with blank in programming? See below for example:

Before - I am searching for AA

AA BBCCAA
ABBAACC
AABBCC

After - the result should be the following:
BBCC
ABBCC
BBCC

Your help on this is appreciated.