id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

regex_verifyZipCode


Given a String, return true if it only contains a 5 digit zip code. Return false if it is not a 5 digit number. It should not have more or less digits. It should have exactly 5 digits and nothing else.


regex_verifyZipCode("77377") → true
regex_verifyZipCode("77377 lol") → false
regex_verifyZipCode("37042") → true

...Save, Compile, Run (ctrl-enter)

public boolean regex_verifyZipCode(String text) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy