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
Install .PFX file to personal store - Certificate Authority
Performance Monitor Wizard tells me log has been deleted create new
Problem connecting Netapp FCP LUN on SERVER 2008
Filtering Mysql Search Results Based a Number of Criteria
Sorry, VMware GO doesn't currently support ESXi servers with multiple datastores.
How can I display this without line breaks
SQLCommandBuilder - GetUpdateCommand, GetInsertCommand and GetDeleteCommand Questions
Shell Api problem
strange connection speed problem
what's different between SAP Crystal Reports and SAP Crystal Reports Server 2008?