Mega Code Archive

 
Categories / Java / Development Class
 

Set character at a given index

public class Main {   public static void main(String[] argv) throws Exception {     StringBuffer buf = new StringBuffer("Java this is a test");     int index = 15;     buf.setCharAt(index, '.');      System.out.println(buf);   } } // Java this is a .est