Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic

Searching and displaying results in a multi-dimensional array.  RSS feed

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm working on a two column array search utility, but I'm stuck on a couple of matters.

1. I want to insure that the utility only searches the first column of the array and ignores the second.
2. When it does find the word in the first column, I want it to display the second column on line 109.

I've got the majority of it written, but like I said, I'm stuck. Help is always appreciated.


 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator

Scotty Steven wrote:I'm working on a two column array search utility, but I'm stuck on a couple of matters.

1. I want to insure that the utility only searches the first column of the array and ignores the second.



What problem are you having with that? Just look in arr[x][0], and not in arr[x][1].

2. When it does find the word in the first column, I want it to display the second column on line 109.



So display arr[x][1].

 
Scotty Steven
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ya, that was stupid simple.

Thanks!
 
Bartender
Posts: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator

Scotty Steven wrote:Ya, that was stupid simple.

Thanks!



In future please CarefullyChooseOneForum
Similar discussion here, locking this one.
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!