This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Java in General and the fly likes identify data type in string? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "identify data type in string?" Watch "identify data type in string?" New topic
Author

identify data type in string?

Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1268

hi ...

I got a string related quesiton .........

if i have a string ="sdfdsdssdfsd34324efgegdf"

and i have to make sure that this will not contain any numeric values...number should not be there or only number required then in such case how am I provie type safty to string ...........

Thanks
Kaustubh


No Kaustubh No Fun, Know Kaustubh Know Fun..
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

So you want to check whether a string contains (or doesn't contain) numbers? You can do that in multiple ways, one of them being through Java regex Pattern

[My Blog] [JavaRanch Journal]
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
The other way is to go trough the whole string and look for digits.

>


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1268

Thanks Friends
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: identify data type in string?
 
Similar Threads
POI Converting Long Number to Sciebtific Notarion
why does it tell me that there is else without if (java programming)?
String..
Need help with code
big binary number to decimal