This discussion is archived
5 Replies Latest reply: Jul 13, 2008 11:20 AM by 843785 RSS

String in buffer

843785 Newbie
Currently Being Moderated
suppose strBuf contains "Welcome to java" before each if the following methods is applied:
strBuf.delete(8 , 11)
will this change the buffer to " welcome java" or "welcome o ava"?
  • 1. Re: String in buffer
    843785 Newbie
    Currently Being Moderated
    zerogpm wrote:
    suppose strBuf contains "Welcome to java" before each if the following methods is applied:
    strBuf.delete(8 , 11)
    will this change the buffer to " welcome java" or "welcome o ava"?
    * headdesk *

    Wouldn't it be quicker, simpler and more reliable to try it yourself?
  • 2. Re: String in buffer
    843785 Newbie
    Currently Being Moderated
    Isn't it slightly absurd asking this when you can run it and find out?
  • 3. Re: String in buffer
    843785 Newbie
    Currently Being Moderated
    zerogpm wrote:
    suppose strBuf contains "Welcome to java" before each if the following methods is applied:
    strBuf.delete(8 , 11)
    will this change the buffer to " welcome java" or "welcome o ava"?
    You forgot to reveal what type strBuf is. Is it a StringBuffer? Have you checked the documentation? Have you run the code?
  • 4. Re: String in buffer
    843785 Newbie
    Currently Being Moderated
    sorry i don have JAVA program with me right now :(
    maybe i just try it when i get home then
  • 5. Re: String in buffer
    843785 Newbie
    Currently Being Moderated
    zerogpm wrote:
    sorry i don have JAVA program with me right now :(
    maybe i just try it when i get home then
    Yeah, that's the answer. Better to do this than to assume that we are at your beck and call as your surrogate Java compiler.