Results 1 to 3 of 3
  1. #1
    ZeCute is offline Member
    Join Date
    May 2010
    Posts
    14
    Rep Power
    0

    Default Exclude character

    Hi!
    I have a short question. I am trying to use the Scanner class to get a specific data from a Vector which I have converted to a string object. I use the replaceAll method to replace the character I donīt wont to get. But my problem is that I have no idea hove I do to exclude the List element char: "[]". Hove can i format my method so I can get rid of them?

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

    Default

    What have you tried? What did it do that you weren't expecting (or what did it not do that you were expecting)? Have you looked at the Pattern class documentation?
    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
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,456
    Rep Power
    25

    Default

    If the [] are always the first and last character, look at using the substring method to get what is in between.

Similar Threads

  1. Replies: 0
    Last Post: 02-22-2010, 01:44 AM
  2. Read from a certain character to a certain character
    By blackstormattack in forum New To Java
    Replies: 0
    Last Post: 03-16-2009, 11:36 AM
  3. Replies: 0
    Last Post: 03-30-2008, 10:12 AM
  4. reading text character by character
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-09-2007, 08:54 PM
  5. Replies: 0
    Last Post: 09-26-2007, 08:42 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
  •