Java Scanner useDelimiter() MethodThe useDelimiter() is a Java Scanner class method which is used to set the delimiting pattern of the Scanner which is in using. There is two different types of Java useDelimiter() method which can be differentiated depending on its parameter. These are:
SyntaxFollowing is the declaration of useDelimiter() method: Parameter
ReturnsThe useDelimiter() method returns this scanner object. ExceptionsNA Compatibility VersionJava 1.5 and above Example 1Output: String: JavaTpoint! 13 + 13.0 = 26.0 false New delimiter: vaT Example 2Output: JavaTpoint Abhishek Male 22 Example 3Output: 1 2 red blue Example 3Output: String: 55 13 + 13.0 = 26.0 77 New delimiter: java.util.Scanner[delimiters=abcd][position=22][match valid=true][need input=false][source closed=true][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\QNaN\E][infinity string=\Q∞\E]
Next TopicJava Scanner Class
|