Results 1 to 1 of 1

Thread: [RESOLVED] Scanner should only stop at newlines but it also stop after a comma

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2001
    Posts
    574

    Resolved [RESOLVED] Scanner should only stop at newlines but it also stop after a comma

    Hello,

    I am using a scanner for reading the input and I want it to also split when newlines are being found. Now I assumed I could do that with the .useDelimiter.
    So I have inserted that code and it seemed to be working. But all of a sudden strange things started occuring and I found out that this happened when there are comma "," is the input. It appearently also splits at a comma. Does anyone have a resolution for this, because this should not be the case.

    Code:
    private static Scanner scanner;
    scanner = new Scanner(System.in, "ISO-8859-1");
    scanner.useDelimiter("\n|\r\n|\r");
    Thanks in advance.

    /update: Never mind I already found the problem, I am using the comma as a seperator in my program and there is where it went wrong
    Last edited by jacsoft; Oct 4th, 2009 at 08:06 PM. Reason: found the problem
    Don't Hate Me Cause You Ain't Me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width