Results 1 to 4 of 4
  1. #1
    Everyman's Avatar
    Everyman is offline Member
    Join Date
    Feb 2012
    Location
    Everywhere
    Posts
    26
    Rep Power
    0

    Default The String Class #1

    Someone help me please:

    "Given the String variable str, write an expression that evaluates to the character at index 0 of str."

    This is something that I have never seen before, and was not in any of the material that we were given to read.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,960
    Rep Power
    8

    Default Re: The String Class #1

    What's your question? What have you tried? Where are you stuck?

    Break your problem up into smaller steps. What is the very next step you know you need to do? Also, check out the API for String for useful functions.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Everyman's Avatar
    Everyman is offline Member
    Join Date
    Feb 2012
    Location
    Everywhere
    Posts
    26
    Rep Power
    0

    Default Re: The String Class #1

    I have just looked at the Java API site and I just tried "str.index(0)" (without quotes).

    edit: It did not work.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default Re: The String Class #1

    Quote Originally Posted by Everyman View Post
    I have just looked at the Java API site and I just tried "str.index(0)" (without quotes).

    edit: It did not work.
    Of course it didn't work and you could've know that if you had actually read the API description. Read the API description of the entire String class again.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 0
    Last Post: 03-27-2011, 05:49 AM
  2. String Class
    By madhav1351 in forum Advanced Java
    Replies: 1
    Last Post: 09-27-2010, 08:15 AM
  3. how to call class using String
    By newbiejava in forum New To Java
    Replies: 5
    Last Post: 08-03-2010, 04:20 PM
  4. My own string class
    By viperlasson in forum New To Java
    Replies: 8
    Last Post: 01-25-2010, 05:55 PM
  5. EXTENDING the string class
    By ferno in forum New To Java
    Replies: 3
    Last Post: 12-11-2007, 09:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •