求大佬解释一下明明输的是+3,为啥隔俩加一个“,”
package Q;
public class a{ public static void main(String[]args){
StringBuilder str=new StringBuilder();
str.append("ywetcvevcvvyjv");
for(int i=2;i<str.length();i=i+3){
str.insert(i,","); }
System.out.println(str.toString()); } }
运行结果: yw,et,cv,ev,cv,vy,jv