Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
validation
dale con
Ranch Hand
Posts: 93
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all
I need to make sure a parameter going through to my method doesn not contains letters.
It's a phone number field so it can contain things like '-' or '+' or '()'etc but it can't contains letters
Can anyone help me write a regex for this
Many thanks
Junilu Lacar
Sheriff
Posts: 17644
300
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What have you tried so far?
- Junilu
How to Ask Questions the Smart Way
Megs Maquito
Ranch Hand
Posts: 84
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Not sure if this is correct but here goes:
public class phoneNumber { public phoneNumber(int aNumber) {.... } }
This way if anyone would use a
String
as parameter i.e. phoneNumber x = new phoneNumber (abc) would result in error as the method requires an integer and not a String.
I'm a Hood Ornament
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
The future of Java Jobs is US?
Adding new elements to ActionForm collection
Validating domain name with struts validator
Grading Program--Need help, please!!!
Read csv file of different datatypes (Eval my code)
More...