Thanks for teaching, there is another simplest way of doing this using enhanced for loop here it is String name = "india"; String unique = ""; char[] charArray = name.toCharArray(); for (char c : charArray) { if (name.indexOf(c) == name.lastIndexOf(c)) { unique += c; } } System.out.println(unique);
Thanks for teaching, there is another simplest way of doing this using enhanced for loop here it is
String name = "india";
String unique = "";
char[] charArray = name.toCharArray();
for (char c : charArray) {
if (name.indexOf(c) == name.lastIndexOf(c)) {
unique += c;
}
}
System.out.println(unique);
thanks again King...
can you please write program which will print first non repeated character?
Love it! Perfectoooo
Perfect!!!