Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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: 38481
    
  23
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Remove a char from ArrayList