Slice String in Java

String.substring(int beginIndex) String.substring(int beginIndex, int endIndex) public class StringExample {     public static void main(String[] args)     {         String string1= “hello world”;         System.out.println(string1.substring(0, 2)); //he         System.out.println(“hello world”.substring(6)); //world

Read more