Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Remove duplicates in string
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { String s1="lovelylikki"; String s2=""; for(int i=0;i<=s1.length()-1;i++) { char ch=s1.charAt(i); int index=s2.indexOf(ch); if(index==-1) { s2=s2+ch; }} System.out.println(s2); }}
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Add Index of max number in an array
Sum of EVEN and ODD nubmers (11 grade)
JAVA sidebar pattern match
1B
10 Wizards
Granite Java
Rabbits in forest (leetod)
cosmology
Variables&Types
Linked List creation
Please log in to post a comment.