• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String Validations

 
kay lin
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9256
9
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
validate a String as an email address
 
Lionel Badiou
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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

Hope that helps,
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like we're doing your assignment if WE think of them instead of YOU thinking of them.
 
kay lin
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
kay lin
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9256
9
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic