So I have this very very bad habit of making things really complicated...
We had this challenge to recreate the method in the String class #replace(CharSequence poop, CharSequence poop2)
The catch was that we had to meet the following guidelines:
- only use the String class methods: substring, charAt, equals, and length
- must use a for loop
So after spending around 20 minutes doing some complicated 40 line thing that looked like:
(yes, this somehow actually worked)
And then I show my friend and goes "oh this is easy"
30 seconds later...
-flips desk-
"I'M OUT"
We had this challenge to recreate the method in the String class #replace(CharSequence poop, CharSequence poop2)
The catch was that we had to meet the following guidelines:
- only use the String class methods: substring, charAt, equals, and length
- must use a for loop
So after spending around 20 minutes doing some complicated 40 line thing that looked like:
(yes, this somehow actually worked)
And then I show my friend and goes "oh this is easy"
30 seconds later...
-flips desk-
"I'M OUT"
