For example I have this string: Hello, world!
and I want to get Hello
by using indexes. Is there a function like
package com.example;
import static java.lang.String.getStringBetweenIndex;
public class Example {
public static void main(String[] args) {
String hello = "Hello, world!";
System.out.println(hello.getStringBetweenIndex(0, 5));
}
}
that gives output Hello
?