I need to do lot of following code in program
int index=temp.lastIndexOf("\\n== External links ==\\");
System.out.println( temp.substring(index))
Indexof,substring,contains so these manipulations will be better in stringbuffer or string?
If so why can you elaborate me?
There’s no
containsor StringBuffer on StringBuilder.The indexOf and substring are delegated to String itself.
StringBuffer and StringBuilder are faster for concatenation, but for looking into the String: take the String class itself