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
Remote Web Workplace in Server 2008?
How to bounce a database which hs RAC, OEM, ASM and dataguard
SSIS and variable issues
sharepoint foundation 2010 on 32 bit?
How do I check if the the value of a column
Backup Exec 2010 on VMWare server backing up iSCSI targets - looking to improve throughput
office 2007 settings not saved in user profile in terminal server
htaccess 302 redirect - seamless hidden url
Columns cannot convert between unicode and non-unicode string data types.
rpmlib(PayloadIsLzma) <= 4.4.6-1 is needed.