I want a output from “Wikipedia” to Wkpeda..remove the duplicate characters in the given string.
public class Problem1 {
public static void removeDuplicate(String s) {
for(int i=0;i<s.length();i++) {
for(int j=i+1;j<s.length();j++) {
if(s.charAt(i)==s.charAt(j)) {
}
}
}
}
public static void main(String[] args) {
String s= "Wikipedia";
removeDuplicate(s);
}
}
New contributor