string - Replacing text in stringbuffer without hardcoding indexes -
i have stringbuffer object contains data "detail is:"
based on result of hashmap(map), populate details below line of looping through map , fetching data.
now want replace text "detail is:" "details are:" if more 1 record fetched.
is way achieve this?
thanks
you can:
- get string out of stringbuffer.
- reset stringbuffer , write new beginning.
- write after replaced prefix buffer.
instead, this:
- omit prefix in first place
- do simple string-concatenation @ end.
Comments
Post a Comment