Delete excluded characters in MSD axapta

 strKeep (Delete excluded chars)

 info("str strKeep(str _text1, str _text2)");  
 info("Deletes all of the characters in a text string that are not included in another text string.");  
 info("_text1 - The first text string.");  
 info("_text2 - The characters to keep in the first text string.");  
 info("strKeep(\"ABBCDDEFGHB\",\"BCD\") " + strKeep("ABBCDDEFGHB","BCD"));