• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remove a char from ArrayList

 
Joana Silva
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
may be you want to use a String library

Oleg.
 
Campbell Ritchie
Sheriff
Posts: 48386
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic