Delimiter in Scanner

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • justjust
    New Member
    • Nov 2008
    • 2

    Delimiter in Scanner

    I want to change delimiter of Scanner completely and set it to "{%" and "%}" only, so i don't want to use white space as delimiter ,haw can i do that?
    plaese write the code too, if it is possible for u!

    thanks!
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    We won't write the codes for you here. Open the API specs for the Scanner class and read them. It's all in there.

    Comment

    • justjust
      New Member
      • Nov 2008
      • 2

      #3
      I've test it, but i didn't get it.

      As i read i conclude that I should write for example:

      //
      sc.useDelimiter ("{%");
      //

      but it occurred many exceptions.
      :(
      thanks!

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        What did you try and what errors did you get?

        Also note that the errors/exceptions also give you a clue as what the problem is.

        Comment

        Working...