import java.util.*;
import java.lang.*;
import java.io.*;
class Main {
public static void main(String[] args) {
String s = "hello world";
char[] c = new char[3];
s.getChars(2, 5, c, 0);
System.out.println(c); // llo
String s1 = "wane";
String s2 = "pane";
System.out.println(s1.regionMatches(1, s2, 1, -1)); // true
System.out.println(s1.indexOf("ane")); // 1
System.out.println(s1.indexOf("tame")); // -1
System.out.println(s1.substring(1)); // ane
System.out.println(s1.replace("w", "b")); // bane
String s3 = " hello world ";
System.out.println(s3.trim().replace("l", "w")); // hewwo worwd
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: