String input = "TestInput";
StringBuilder b = new StringBuilder();
b.append(input.charAt(0));
for (int i = 1; i < input.length(); i++) {
b.append("*").append(input.charAt(i));
}
System.out.println(b);
}
gives:
T*e*s*t*I*n*p*u*t
No comments:
Post a Comment