Microsoft
Software
Hardware
Network
Question : Check numbers in string
I have a string, that could have SSSSSS-SSSS or SSSSSSSSSS ( S = number 0-9). I need someting to check this. That means it could be 10 numbers with or without the '-'. How could I check it the easiest way?
return true if valid. return false otherways.
Answer : Check numbers in string
Try
1: 2:
final String RE = "\\d{6}-?\\d{4}"; boolean valid = s.matches(RE);
Random Solutions
Excel VBA Select All File Types From a Specified Folder
Will an AGP Video Card work in a PCI Express Slot?
How would I edit the code for additional levels from: How can I prep text files for import into Excel that are in subheading formats?
OMA and OWA
mysql stored proc parameter
"File Helper" reporting - Your system may have upopenable files - Why?
How to make WPF button background color silver?
PIX 515 to ASA 5505 VPN tunnel problems...
Disabling software restriction policy
windows xp 64 bit on APPLE IMAC 27 inch