On Mon, Nov 15, 2010 at 8:37 AM, kk <[email protected]> wrote: > private StringBuilder m_healthString = new StringBuilder(8); > I update by doing: > m_healthString.replace(0, 8, Integer.toString(myHealth)); > Is this expensive/wrong? Is there a better way to update a > StringBuilder with a new String? >
You haven't gained anything here, because Integer.toString() has already had to make a string for that integer before you even get in to the StringBuilder. -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

