• Post Reply Bookmark Topic Watch Topic
  • New Topic

Remove a char from ArrayList  RSS feed

 
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 # ?
 
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.
 
Marshal
Posts: 58302
178
  • 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
Boost this thread!