import java.util.Scanner; class DuplicateRemover { public static void main(String[] args) { Scanner sc = new Scanner (System.in); String s; char sa[]; System.out.print("Enter a String:"); s = sc.nextLine(); sa = new char[s.length()]; for(int i=0 ; i<s.length(); i++){ sa[i]=s.charAt(i); } for(int i=0; i<sa.length; i++){ boolean b = true; for(int j=0; j<i; j++){ if(sa[i]==(sa[j])){ b = false; break; } else if (Character.isWhitespace(sa[i])){ b = false; break; } } if(b==true) System.out.print(sa[i]); } } } | 0 |
By: [email protected] On: Thu Jun 21 21:19:55 IST 2018 0 0 0 | 0 |
Are You Satisfied :0Yes0No |
import java.util.Scanner; class DuplicateRemover { public static void main(String[] args) { Scanner sc = new Scanner (System.in); String s; char sa[]; System.out.print("Enter a String:"); s = sc.nextLine(); sa = new char[s.length()]; for(int i=0 ; i<s.length(); i++){ sa[i]=s.charAt(i); } for(int i=0; i<sa.length; i++){ boolean b = true; for(int j=0; j<i; j++){ if(sa[i]==(sa[j])){ b = false; break; } else if (Character.isWhitespace(sa[i])){ b = false; break; } } if(b==true) System.out.print(sa[i]); } } } | 0 |
By: [email protected] On: Thu Jun 21 21:20:14 IST 2018 0 0 0 | 0 |
Are You Satisfied :0Yes0No |