aspose file tools*
The moose likes Java in General and the fly likes String Validations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "String Validations" Watch "String Validations" New topic
Author

String Validations

kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
hi:
can somebody think of some string validation methods. Because a task given to me is to think of some creative validation methods on String, so far i have coded


i am open to suggestions. What are some of the String Validations you might run across at work? plz let me know


Many thanks
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

validate a String as an email address


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Lionel Badiou
Ranch Hand

Joined: Jan 06, 2005
Posts: 140
Hello,

You may use the 'matches' method from String class. Did you check the Java'sregular expression facilities ?

Hope that helps,


Lionel Badiou
CodeFutures Software
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Sounds like we're doing your assignment if WE think of them instead of YOU thinking of them.
kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Originally posted by Carol Enderlin:
Sounds like we're doing your assignment if WE think of them instead of YOU thinking of them.


Hey Carol, this is a free world. You have the freedom to express or hold your opinions. I simply posted on the forum to get more ideas from others because I have a few ideas already and I simply would like to know what other people have on their mind. Because we each work in different fields, sometimes one validation method comes to mind more naturally than the others. That is what the forum is here for. If you feel for whatever reason that I am getting a free ride out of this, you dont have to post here. Further more, you are allowed NOT to give me any suggestions even if you have any
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
This is called "making up requirements" which in my work life is a dangerous path, but otherwise can be a lot of fun. Try to think of programs you have used that asked you to enter data. DOS or UNIX command arguments? How about guessing games or puzzles? Maybe an address book program? What kind of rules would they enforce? I used to do a lot of console input in another language and had a rather elaborate little suite of input validators. Let us know what you come up with!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Hi there,

To me, it doesn't really matters if you're a student or not. What matters is that you're not using your real name.

I'm sure your name isn't dog (but if it is, I'm sorry). Would appreciate if you could change your display name to your real name.

I guess it makes people more comfortable knowing that the guy that you're conversing with is not afraid of disclosing his/her name.

Cheers!


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Originally posted by Cheng Wei Lee:
Hi there,

To me, it doesn't really matters if you're a student or not. What matters is that you're not using your real name.

I'm sure your name isn't dog (but if it is, I'm sorry). Would appreciate if you could change your display name to your real name.

I guess it makes people more comfortable knowing that the guy that you're conversing with is not afraid of disclosing his/her name.

Cheers!


Lin is my last name...and i was born in the year of the dog.
why should i use my real name online? That just defeats the whole purpose of the anonymous intimacy the web provides us...

btw..here are one more method I came up with

isAlphaNumeric()// this one just checks to see of if what the user entered is alpha numeric...
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8713
    
    6

Originally posted by dog lin:

Lin is my last name...and i was born in the year of the dog.
why should i use my real name online? That just defeats the whole purpose of the anonymous intimacy the web provides us.


We don't like to be anonymous here at the Ranch. Lots of people use the anynomity the web to hide them while they post insults and flames. We want friendly folks posting here, and friendly folks don't have any problem standing up and introducing themselves. Please change your displayed name to conform to our
naming policy. In short, your name must be a first name and last name, separated by a space and not obviously fake.
kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Originally posted by Joe Ess:


We don't like to be anonymous here at the Ranch. Lots of people use the anynomity the web to hide them while they post insults and flames. We want friendly folks posting here, and friendly folks don't have any problem standing up and introducing themselves. Please change your displayed name to conform to our
naming policy. In short, your name must be a first name and last name, separated by a space and not obviously fake.


I have never posted any insult or flames..and I never will....but i changed my name to my real name
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Thanks, Karen. It's not that everyone who uses a fake name posts insults - certainly not. But we believe that communities with a lot of anonymous posters are more prone to exchanging insults. So we try to encourage the use of real names as much as possible. Thanks...


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String Validations
 
Similar Threads
Pass by value & pass by reference data types
difference between these methods...
Validation question
How to catch the Tab key code
Data validation - Best practice - at what level