Sample Code:
String emailaddress = 'itzbiswajeet@gmail.com'; System.debug(emailaddress.replaceAll('(^[^@]{2}|(?!^)\\G)[^@]', '$1*'));
Sample Code:
String emailaddress = 'itzbiswajeet@gmail.com'; System.debug(emailaddress.replaceAll('(^[^@]{2}|(?!^)\\G)[^@]', '$1*'));