Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

all possible substrings of a string java of specific length

String s = "example string";
for (int i = 0; i <= s.length() - 3; i++) {
    String substr = s.substring(i, i + 3);
    if (substr.matches("[a-zA-Z]+")) { System.out.println(substr); }
}
Comment

PREVIOUS NEXT
Code Example
Java :: display 2d array 
Java :: indexof list java 
Java :: android studio find all views in layout 
Java :: Java reduce() Method 
Java :: how to find odd and even in a array 
Java :: how to sort the arraylist without changing the original arraylist 
Java :: difference between synchronized block and synchronized method example 
Java :: null java 
Java :: how to change background color of grid in grid layout in android 
Java :: java instanceof operator 
Java :: java loop through array 
Java :: 2-dimensional Array java 
Java :: java assert 
Java :: regex java 
Java :: how to create textview in java android 
Java :: Java 7. Converting List<List<Integer to int[][]: 
Java :: MD5 java 
Java :: uml to java 
Java :: capture console output java 
Java :: what is construct in java 
Java :: Java Singleton Class Syntax 
Java :: convert java code to kotlin online converter 
Java :: How to perform in-order traversal of a binary tree? 
Java :: private access modifiers 
Java :: method overloading 
Java :: instantiation in java 
Java :: Permutations of array in Java 
Java :: convert code from kotlin to java 
Java :: factorial recursion java 
Java :: print all prime no java 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =