• Post Reply Bookmark Topic Watch Topic
  • New Topic

Search and replace in two-dimensional array  RSS feed

 
Cheikh Sow
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help searching and replacing through a two-dimensional array
basically I have:
String array [][] = {"1", "A", "B", "C", },
{"2", "A", "B", "C", },
{"3", "A", "B", "C", },
{"4", "A", "B", "C", },
{"5", "A", "B", "C",} };
Ask the user to input two characters that are in the array
if the user input 1A I print again the array but replacing A with '*' or until the user quit.
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't get the question. If user enters 1A then you'll replace A with * . I think there is something wrong here. And also what do you mean by until the user quits??
 
Joseph Macer
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you want to replace a part of the array the user specifies with an asterisk. Two tips to get help:
1) Use better English, and a little more of it. Is "trought" a type of fish?
2) This sounds like a homework assignment, in which case we can still help you, but more info about what you need to do is required. Also read this:
http://faq.javaranch.com/java/DoYourOwnHomework
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joseph Macer wrote:1) Use better English, and a little more of it. Is "trought" a type of fish?
No, that isn't funny. It is a simple spelling mistake, and you are close to causing offence. Please apologise.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!