string program
Hello every body,
i need some help on this program suppose string str="computer"
i want output like
computer
omputerc
mputerco
putercom
utercomp
tercompu
ercomput
rcompute
computer
plz help me
with regards,
Anil.m
Hello every body,
i need some help on this program suppose string str="computer"
i want output like
computer
omputerc
mputerco
putercom
utercomp
tercompu
ercomput
rcompute
computer
plz help me
with regards,
Anil.m
String sorig = "computer";
System.out.println(sorig);
for (int i = 0; i < sorig.length(); i++){
sorig = sorig.substring(1) + sorig.substring(0,1);
System.out.println(sorig);
}
public class Test {
public static void main(String[] args) {
String c ="computer";
for(int i=0;i<c.length();i++){
String s="";
c=s.concat(c.substring(1,c.length())).concat(c.substring(0,1));
System.out.println(c);
}
}
}
-TC
Message was edited by:
DAmm man.. slow connection again>