aspose file tools*
The moose likes Beginning Java and the fly likes Check the String for a Date OR Number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Check the String for a Date OR Number" Watch "Check the String for a Date OR Number" New topic
Author

Check the String for a Date OR Number

smitha rai
Ranch Hand

Joined: Aug 15, 2001
Posts: 33
Hi,
I am new to Java and I want to know the given string is a string or number or in date format (say, dd-mm-yyyy OR mm/dd/yyyy, etc). Appreciate if any one help me out with a code?
Thanks and regards,
Smitha
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
You could use the Character.isDigit(char) method of the Character class. It determines if the specified character is a digit and returns a boolean result.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Smitha,
An underscore is not the same as a space. Please read http://www.javaranch.com/name.jsp and re-register. We would like you to continue to post here at JavaRanch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Check the String for a Date OR Number