java - how do i compare each character of a same string using a for loop? -


so have make program have compare each character of string see if occur in string more once or not, if occur more once have delete string array list instance "peer" , "pear" should remove "peer" because there 2 e's in "peer", how go doing this?

here hint. check whether there duplicate character can use set.

for each character of string     check if char in set     if yes          can delete string arraylist , stop checking string     else          add char set 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -