File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in regex

 
Sidharth Khattri
Ranch Hand
Posts: 125
Java Linux Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question is from CertPal
Though I've read about invocation of useDelimiter() on Scanner, but I don't know about Scanner.delimiter() and I couldn't find it.
It's used in this program(highlighted with a comment).
Does scanner.delimiter() return an instance of Pattern? If yes, what is the argument in that Pattern's instance?
I only knew the following way to instantiate Pattern:
Pattern p = Pattern.compile("\\d");

 
Henry Wong
author
Marshal
Pie
Posts: 20835
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sidharth Khattri wrote:
Though I've read about invocation of useDelimiter() on Scanner, but I don't know about Scanner.delimiter() and I couldn't find it.


Generally, the javadoc is a good place to start, when searching about methods -- see java.util.Scanner. And yes, it returns the pattern that is being used as a delimiter.

Henry
 
Sidharth Khattri
Ranch Hand
Posts: 125
Java Linux Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Sidharth Khattri wrote:
Though I've read about invocation of useDelimiter() on Scanner, but I don't know about Scanner.delimiter() and I couldn't find it.


Generally, the javadoc is a good place to start, when searching about methods -- see java.util.Scanner. And yes, it returns the pattern that is being used as a delimiter.

Henry


Thank you Henry. Really appreciate your help
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic