@@ -0,0 +1,1238 @@
+%0A%0Apublic class StringDemo %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        String testString;%0A        String%5B%5D testStringArray;%0A        String joinedTestString;%0A%0A        // Char literals are single quoted.%0A        // String literals are double quoted.%0A        testString = %22  Hello World Redux  %22;%0A%0A        System.out.println(%22Contents of testString:%22);%0A        System.out.println(testString);%0A%0A        System.out.println(%226th character in the testString:%22);%0A        System.out.println(testString.charAt(8));%0A%0A        System.out.println(%228th to 12th characters, inclusive:%22);%0A        System.out.println(testString.substring(8, 13));%0A%0A        System.out.println(%22testString length:%22);%0A        System.out.println(testString.length());%0A%0A        System.out.println(%22Index of the first occurence of 'R':%22);%0A        System.out.println(testString.indexOf('R'));%0A%0A        System.out.println(%22Whitespace-stripped testString:%22);%0A        System.out.println(testString.trim());%0A%0A        System.out.println(%22testString, split on %5C%22World%5C%22 and rejoined:%22);%0A        testStringArray = testString.split(%22World%22);%0A        joinedTestString = testStringArray%5B0%5D.concat(testStringArray%5B1%5D);%0A        System.out.println(joinedTestString);%0A    %7D%0A%0A%7D%0A%0A%0A%0A%0A%0A

Add String demo