I am trying check below string in the if condition but apparently it is not satisfying the string comparison condition even though system.debug shows the same string.
String APH = test.substring(0,3);
system.debug('inside APH '+ APH ); // outputs A&P
if(APH == 'A&P '){
system.debug('after substring '); // not printing
}
I have even tried to do this but still not working
if(APH == 'A\\&P '){