Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to check if a string contains only alphabets and numbers in java

string.matches("[a-zA-Z]*"); // return true if it has only letters 
string.matches("[0-9]*"); // return true if it has only numbers 
string.matches("[a-zA-Z0-9]*"); // return true if it has only letters and numbers
Comment

PREVIOUS NEXT
Code Example
Java :: java initialize list with values 
Java :: java pause 
Java :: react-native force rtl on android 
Java :: change font size java swing 
Java :: android open browser 
Java :: main code of java 
Java :: springboot starter jpa 
Java :: how to make javafx full screen default 
Java :: java close application 
Java :: Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer 
Java :: android coding how to open map 
Java :: stringjoiner stream java 
Java :: random.choice in java 
Java :: java convert string to int 
Java :: how to print a matrix in java 
Java :: format localdatetime 
Java :: java stream sorted reverse 
Java :: how to implement linked list in java without using collection framework 
Java :: InetAddress.getByAddress example 
Java :: java for map 
Java :: java radnom 
Java :: android studio allow http 
Java :: find area of trapezoid with sides only in java 
Java :: javafx live date and time 
Java :: java font 
Java :: java get location of jar file 
Java :: android java string to double 
Java :: how to restart activity in android 
Java :: How to iterate over a list in Java? 
Java :: list java processes 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =