replace substring at index java

Solutions on MaxInterview for replace substring at index java by the best coders in the world

showing results for - "replace substring at index java"
Agustín
01 Jan 2018
1public static void main(String[] args) {
2
3        StringBuffer buf = new StringBuffer("123456789");
4
5        int start = 3;
6        int end = 6;
7        buf.replace(start, end, "foobar"); 
8        System.out.println(buf);
9
10    }
11
12}
13