String up="hello world";
String end;
String w;
for(int i=0;i<up.length();i++){
n=0;
z=3;
end="hello world";
w=end.substring(n,z);
end=end.replace(w,"");
System.out.println(end);
}
System.out.println("-->");
Here i have this string up and i just want to replace each alphabet in string with "" and update the replaced string at the end of loop for example: initially we have up="hello world" after first iteration i want it to be up="ello world"