We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,301 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

comparing two strings with linear search..

/**
* 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

2
Contributors
1
Reply
19 Hours
Discussion Span
9 Years Ago
Last Updated
2
Views
antaeus
Newbie Poster
1 post since Oct 2003
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Couldn't you just do something like

if(artistName.equals("artistCD")){
    //do something if it's true
}else{
    //do something if it's false
}

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 :P

Iron_Cross
Junior Poster
117 posts since Jul 2003
Reputation Points: 46
Solved Threads: 2
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0579 seconds using 2.68MB