title: Look for repeated characters in a string
body: <p>I know this question was asked many times, but I didn't find any of the answers helpful in my case. I have a method that receives a String. I want to check if any of the characters in the string are repeated. If so the method will return an empty String. If not it will return the String back.
  The method is looking for any repeated character in the String.</p>
  
  <pre><code>private String visit(String word) {
      int count = 0;
      if(word == ""){
          return "&lt;empty&gt;";
      }
      //alphabet is an array that holds all characters that could be used in the String
      for(int i = 0; i &lt; alphabet.length; i++){  
          for(int j = 0; j &lt; word.length(); j++){
  
              if(alphabet[i] == word.charAt(j)){
                  count++;
              }
              if(count == 2){                 
                  return "";                                              
              }
          }
          count = 0;
      }           
      return word;        
  }
  </code></pre>