Java tutorial
import java.io.*; public class Main { public static void main(String[] args) { String s = "tutorial from java2s.com"; StringWriter sw = new StringWriter(); // write strings sw.write(s, 0, 4); sw.write(s, 5, 6); System.out.println(sw.toString()); } }