This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Remove a char from ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Remove a char from ArrayList" Watch "Remove a char from ArrayList" New topic
Author

Remove a char from ArrayList

Joana Silva
Greenhorn

Joined: Feb 28, 2009
Posts: 5
hi I have this arraylist ArrayList<String> orca = new ArrayList<String>();

Each index contais this:

###########################
#...........O.............#
#.######.R######.H#######.#
#.#......#...........#....#
#O###....#...........#....#
#.#.....G#...........#....#
#.#.....O.######.....#....#
#.................B....O..#
###########################

How can I deleteeverything besides # ?
Oleg Tikhonov
Ranch Hand

Joined: Aug 02, 2008
Posts: 55
Hello,
may be you want to use a String library

Oleg.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43892
    
  32
You cannot delete from Strings at all.
You can create new Strings with methods of the String class (eg replaceAll) or remove parts of the text with the java.lang.StringBuilder class, however.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Remove a char from ArrayList
 
jQuery in Action, 3rd edition