File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

Searching and displaying results in a multi-dimensional array.

 
Scotty Steven
Ranch Hand
Posts: 80
  • 0
  • 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.


 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ya, that was stupid simple.

Thanks!
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic