public static void main(String[] args) {
String s = "I do not want to learn Java. I want a big salary";
// Run loop or whatever you ne
StringBuilder sb = new StringBuilder(s);Z
for(int i=0;i<sb.length();i++)
{
char temp = sb.charAt(0);
if(sb.indexOf(temp+"")== 0)
{
sb.deleteCharAt(sb.indexOf(temp+""));
}
System.out.println(sb);
}
//write your code here
}
please can someone help me out here i don't know what to do here
Resolved
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Guadalupe Gagnon
6 February 2019, 15:12
What task are you on? Copy and paste code doesn't tell us anything, you should only attach code like this:
.
![]()

0
Oghoro Bob
8 February 2019, 11:01
just posted the task number now task number task1011
0
Guadalupe Gagnon
8 February 2019, 14:19
#1 remove the 'Z' at the end of the line:
StringBuilder sb = new StringBuilder(s);Z <----- remove that Z
#2 you need to output "I do not want to learn Java. I want a big salary" 1 full time, your loop starts by cutting off the first character. I suggest just putting a sys.out.println(sb) directly before the loop.
#3 the task requirement want you to make exactly 43 lines. Starting at 1 because you already output the full line once, the for loop should be:
for(int i = 1; i < 43; i++)
0
Oghoro Bob
10 February 2019, 00:30
Thanks alot it worked out.
0