Getting bug while decoding the morse : I,m trying to decode a given morse into English. However, I'm getting a bug in the code I've written. Here is my code :

        1. String code=".... . -.--   .--- ..- -.. ."; //Decodes to "HEY JUDE"
		2. String[] letters = code.split(" ");
		3. StringBuilder res = new StringBuilder();
		4. for(String str : letters){
		5.   if(!str.equals(""))
		6.     res.append(MorseCode.get(str));//get is a method which takes a String input (morse code) and returns appropriate letter as a String
		7.   else res.append(" "); //If I write like this the output will be : "HEY   JUDE"
		8. }
        9. System.out.println(res);

At line 7 if I write 
       
        res.append("");
Output will be : "HEYJUDE"<br>Please correct me If I miss something.
