Try using a
strLine = (br.readLine().trim()) The trim method as part of the String library will remove any whitespace characters on the line you read into the buffer. Hope this helps :-?