- Joined
- Aug 10, 2019
- Messages
- 1
For those you cant see the image, this is what i wrote =D.
public class ForumPost {
public static void main(String[] args) {
System.out.println("Howdy there poeple. My name is liquidlegs");
String line = "I just wanted to say how much i hate this game.\nYou guys are suck!";
String[] sentence = line.split(" ");
for(int index = 0; index < sentence.length; index += 1)
{
if(sentence[index].contentEquals("hate"))
sentence[index] = "love";
if(sentence[index].contentEquals("suck!"))
sentence[index] = "Awesome!";
}
String output = "";
for(String index : sentence)
output += index + " ";
System.out.println("\n" + output + "\n\nHappy tea drinking for everyone! =D");
}
}
public class ForumPost {
public static void main(String[] args) {
System.out.println("Howdy there poeple. My name is liquidlegs");
String line = "I just wanted to say how much i hate this game.\nYou guys are suck!";
String[] sentence = line.split(" ");
for(int index = 0; index < sentence.length; index += 1)
{
if(sentence[index].contentEquals("hate"))
sentence[index] = "love";
if(sentence[index].contentEquals("suck!"))
sentence[index] = "Awesome!";
}
String output = "";
for(String index : sentence)
output += index + " ";
System.out.println("\n" + output + "\n\nHappy tea drinking for everyone! =D");
}
}