function delete(str,s){ |
1 2 3 4 | let reg = RegEXP(s,'g') let ss = str.replace(reg,"") return ss } |
import java.util.*; public class Duplicate {
public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); while(sc.hasNext()) { String str = sc.nextLine(); String str2 = sc.nextLine(); StringBuffer str1 = new StringBuffer(str); for(int i = 0; i < str2.length(); i++) { for(int j = 0; j < str1.length(); j++) { if(str2.charAt(i) == str1.charAt(j)) { str1.deleteCharAt(j); } } } String str3 = str1.toString(); System.out.println(str3); } }
}