943,840 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 13133
  • Java RSS
Oct 15th, 2003
0

comparing two strings with linear search..

Expand Post »
/**
* Compares an artist string to this CD's artist to check if the
* two strings match exactly (ignoring case).
*
* @param otherArtist An artist's name.
* @return true if otherArtist and artist variables are the same
* ignoring case (String comparison).
*/
public boolean equalsArtist( String otherArtist ) {
return false;
}

how do i do this i am kinda confused any help would be cool
Last edited by antaeus; Oct 15th, 2003 at 6:24 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
antaeus is offline Offline
1 posts
since Oct 2003
Oct 16th, 2003
0

Re: comparing two strings with linear search..

Couldn't you just do something like

Java Syntax (Toggle Plain Text)
  1. if(artistName.equals("artistCD")){
  2. //do something if it's true
  3. }else{
  4. //do something if it's false
  5. }
where artistName is a variable for the artists name, and artistCD is a variable for the artist's cd. If that's not what you're looking for then I'm confused as to what you're asking
Reputation Points: 46
Solved Threads: 2
Junior Poster
Iron_Cross is offline Offline
117 posts
since Jul 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Enemy Storage/Selection file
Next Thread in Java Forum Timeline: New to Java





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC