473,473 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

useDelimiter @ Scanner class

5 New Member
Hello,

I've been googling for a while and I can't really find any help with my issue and I'm starting to get frustrated.

Add to the program a call to the Scanner's useDelimiter("...") method so that the tokens returned are all characters between any number of blanks.

Change the String parameter to the useDelimiter method so that the tokens are all characters between the word Scanner.

Change the String parameter to the useDelimiter method so that the tokens are all characters between any number of digits.

Change the String parameter to the useDelimiter method so that the tokens are

any number of digits.
Change the String parameter to the useDelimiter method so that the tokens are any number of letters (upper and lower case).
I have to use the useDelimiter to get certain stuff from the file I am reading as you can see.

Change the String parameter to the useDelimiter method so that the tokens are any number of letters (upper and lower case).
For this one, I know what to do as the professor has given us an example:

Expand|Select|Wrap|Line Numbers
  1. readFile.useDelimiter("[^a-zA-Z]+");
  2.  
But what about the others, for example the one you just wanna get the digits, what would it be?

[^0-9]+ ? Because it doesn't work. I don't know the syntax to use (regex?) and I would like to help on this because I can't figure it out.

Thanks
Dec 5 '07 #1
0 4293

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: Wade Leftwich | last post by:
Every couple of months I have a use for the experimental 'scanner' object in the re module, and when I do, as I did this morning, it's really handy. So if anyone is counting votes for making it a...
9
by: Dan =o\) | last post by:
Hey guys, I wonder if you could please provide me with some ideas as to how to get around this problem. Symbol MC9000-k, Pocket PC 2003... With a scanner application I've written, data is...
7
by: DemonWasp | last post by:
I've been having some trouble getting the Scanner class to operate the way I'd like. I'm doing some fairly basic file IO and I can't seem to get the class to load the last line/token any way I try....
1
madhoriya22
by: madhoriya22 | last post by:
Hi, My JVM does not support java.util.Scanner class. Is it too new or too old for Scanner class. Currently I am working on jdk1.5.0_04. While using Scanner class java compiler shows this message :-...
3
by: thename1000 | last post by:
Hi, I'm trying to create this output: Input team 1's name: Team 1 Input team 1's ranking: 90.4 etc.
3
by: Dameon99 | last post by:
Hi.. Im experiencing a weird error I dont know how to fix. I have a scanner object and whenever I use nextInt, anything above 3 causes the program to crash saying and links me to this line of the...
7
by: kidosai | last post by:
hi i need a guide on how to use the scanner class... i need to use Java Scanner class to read a text file and be able to print the text inside of it... example : i have a text file named...
2
by: bvav22 | last post by:
Hey guys, im trying to finish an assignment for a java class, and i have finished the program except for one part. The program requires that i take 3 values inputted from the user, the first 2 must...
6
by: rotaryfreak | last post by:
Hi everyone, ive had this problem for a while and i cant seem to figure out why. I am using eclipse to create my java code. When import the Scanner class, create a new object and so on... ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.