1. StringBuffer replacing String for memory Issues Help!! bytes.comHi All I wanted to replace the String Concatenation using " + " with a string buffer to eliminate performance hogs. I have a string String str = "Testing "+ firstStrVariable ... |
2. Replacing Strings.... without StringBuffer? coderanch.comOkay... So, I'm doing an assignment for my java class, and our teacher has written a halstead metrics program for us as a template. We're to modify the program to apply to the java language, i.e. take a simple program and count all the different "verbs" and "nouns", then compute the halstead metrics for it. The problem is recognizing symbols that ... |
3. How to replace a small string from a big StringBuffer coderanch.comYou should prob'ly use a DOM library if you can find one. There are a variety of them that are tailored toward various uses. If you are absolutely certain that the string you want to change will not be part of the markup, you could certainly use StringBuilder/StringBuffer. (i.e. "Frankensteen" => "Frankenstein") |
4. Can we replace StringBuilder where we used StringBuffer in JDK1.5 coderanch.comStringBuffer has been retrofitted to extend class java.lang.AbstractStringBuilder (which is not public). Almost all methods actually just call the matching overridden method (e.g. append calls super.append). StringBuilder also extends AbstractStringBuilder, so it inherits those methods as well. Now there may be a single method that isn't available in StringBuilder (but I doubt there is), so from the compiler's point of view ... |
5. StringBuffer replace method forums.oracle.com |
6. StringBuffer replace question forums.oracle.comokay, thanks that worked! the question I have, is that it makes a match repeatedly during the while loop, but then doesn't do the replace until flag is -1. I don't understand how the test2.replace command replaces every instance; I was thinking I would need to find test2.indexOf(match2), then replace, then find the nex test2.indexOf(match2) replace again, then when flag = ... |