Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nobita

macrumors 6502
Original poster
Oct 5, 2008
425
2
La la land
Hello everyone,

I'm in a middle of confusion now. I'm trying to use the String java class to replace all occurences of word in sub to word in put. The problem is, this doesn't work:

String sub = "Hello";
String put = "Hi";

line.replaceAll(sub, put);

I've been searching through google and other stuff, but I still couldn't understand what went wrong, please help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.