I have a string "dog,cat,tree" I want to delete cat so it becomes "dog,tree". the replace function of string only accepts a char so method String_Object.replace(char,char) is not compatible with what I need which is a String_Object.replace(String,String). Any other alternative functions I can use?
posted 11 years ago
There's a function String#replaceAll(String, String) since JDK 1.4.
Otherwise, you can use indexOf and substring methods