7 Replies - 738 Views - Last Post: 03 October 2012 - 11:19 AM Rate Topic: -----

#1 Shona213  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 03-October 12

question

Posted 03 October 2012 - 10:42 AM

Assume that word is a variable of type String that has been assigned a value. Assume furthermore that this value always contains the letters "dr" followed by at least two other letters. For example: "undramatic", "dreck", "android", "no-drip".

Assume that there is another variable declared, drWord , also of type String. Write the statements needed so that the 4-character substring word of the value of word starting with "dr" is assigned to drWord . So, if the value of word were "George slew the dragon" your code would assign the value "drag" to drWord .

Is This A Good Question/Topic? 0
  • +

Replies To: question

#2 CasiOo  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1408
  • View blog
  • Posts: 3,123
  • Joined: 05-April 11

Re: question

Posted 03 October 2012 - 10:43 AM

I assume you have a question?
Was This Post Helpful? 2
  • +
  • -

#3 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,885
  • Joined: 06-March 08

Re: question

Posted 03 October 2012 - 10:47 AM

Your topic title is "question" this is not a very descriptive title as our rules say: Use "txt" speak (i.e. please, hlp, thanks)
Also the code you post should be between code tags :code:

The String class has all the methods required to perform your task, more specifically indexOf() and subString()
Was This Post Helpful? 0
  • +
  • -

#4 Shona213  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 03-October 12

Re: question

Posted 03 October 2012 - 10:48 AM

yes i have no idea what the question is asking for can anyone clarify
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5365
  • View blog
  • Posts: 27,329
  • Joined: 10-May 07

Re: question

Posted 03 October 2012 - 10:53 AM

Sounds like a 'copy & paste' home work question. If you truly do not understand what it's asking, then you should consult your instructor.

We can assist you with programming related questions to your code, however we are not in your class, so we are not familiar with your assignment.
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,885
  • Joined: 06-March 08

Re: question

Posted 03 October 2012 - 10:53 AM

find in a word the string "dr"
store that "dr" and the two folling characters into an other variable names drWord
Was This Post Helpful? 0
  • +
  • -

#7 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7895
  • View blog
  • Posts: 13,424
  • Joined: 19-March 11

Re: question

Posted 03 October 2012 - 11:13 AM

This seems like a very clear assignment to me. Try to interpret it for us as well as you can, and bring us to the point where you're stuck.
Was This Post Helpful? 0
  • +
  • -

#8 Shona213  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 03-October 12

Re: question

Posted 03 October 2012 - 11:19 AM

thanks that what i needed
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1