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:

  1. get string out of stringbuffer.
  2. reset stringbuffer , write new beginning.
  3. write after replaced prefix buffer.

instead, this:

  1. omit prefix in first place
  2. do simple string-concatenation @ end.

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -