www.lauttmoc.iru
/**
* @author lautturi.com
* Java example: String methods example
*/
import java.util.*;
public class Lautturi {
public static void main(String[] args) {
String first = "HELLO";
String last = new String(" java");
String full = first.concat(" ").concat(last);
System.out.println(first); // HELLO
System.out.println(last); // java
System.out.println(last.trim()); // java
System.out.println(full); // HELLO java
System.out.println(first.charAt(0)); // H
System.out.println(last.charAt(last.length() - 1)); // a
System.out.println(first.toLowerCase()); // hello
System.out.println(last.toUpperCase()); // JAVA
System.out.println(first.equals(last)); // false
System.out.println(full.substring(2,8)); // LLO j
System.out.println(full.substring(full.indexOf(' ') + 1)); // java
System.out.println(full.indexOf('a')); // 8
System.out.println(full.lastIndexOf('a')); // 10
System.out.println(first.replace('v', 'x')); // HELLO
}
}