String, text, numbers, I/O I part
Visit us here and you will find
much more tips!
Receive our newsletter with new tips! Almost 6,000 subscribers (by June 2001) can not be wrong!
They read our tips every week!
To subscribe to The Java FAQ Daily send empty e mail to:
javafaq tips subscribe@topica.com
or visit at:
http://www.topica.com/lists/javafaq tips/
String, text, numbers, I/O I part
An idea for validating the phone number field on a form..,
Does anyone have an idea for validating the phone number field on a form. I am
looking for something that will basically check this input mask
*111*111*1111*
Where the 1 s are number s and the * s are either . spaces, or any
other character like (). Please advise.
Answer1: You could use a regular expression package. For example, Jakarta ORO:
http://jakarta.apache.org/oro/
Answer2: i m thinking regular expressions. See:
http://www.cacas.org/java/gnu/regexp/
http://www.crocodile.org/~sts/Rex/
Could someone show me a basic File I/O example? I just can t figure out
streams. I m willing to accept basic mockery in exchange...
Could someone show me a basic File I/O example? I just can t figure out streams.
I m willing to accept basic mockery in exchange...
Answer:
import java.io.*;
public class FileIO {
public static void main(String[] args) throws Exception {
if(args.length!=1){
System.out.println("Invalid parameters!!!");
System.exit(0);
}
File fl = new File(args[0]);
FileReader fileReader = new FileReader(fl);
BufferedReader bufferedReader = new BufferedReader(fileReader);
file:///F|/a_jsite/350_tips/stings_text__date_numbers_io I.htm (1 of 7) [2001 07 08 11:24:59]
footer
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved