This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Do we have any method in Java in String or StringUtils to remove an element from a string aray by index.
like remove(startindex,endIndex) in C#.
I looked over internet and StringUtils too,but i couldnt find any.
What would be the simplest method without adding performance -slow-down to my project to do this?
I already have lot of Stringbuilder -String conversions in my method.
Well, a StringBuffer or StringBuilder doesn't model an array of Strings, so that really isn't a candidate anyway. What I would recommend is to stop using arrays if you need a list of strings whose length can change from time to time. In particular I would recommend an ArrayList<String> -- if you check the documentation you'll find it has a method to remove a sub-list as you described.