• Post Reply Bookmark Topic Watch Topic
  • New Topic

String/String Array: if function  RSS feed

 
guenay oezcan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
My question is:
(I shortened the code, but you will get the point)


I didn't find out yet, how i can manage that to work..
I hope the right way, however, just requires an editing inside the if(..) part :P

 
Joel Christophel
Ranch Hand
Posts: 250
1
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off, welcome to the ranch!

The way we easily gain access to the values of an array is through the use of an enhanced for loop.



To check the equality of s with the values of the array you could use an enhanced for loop like this:



Here's an explanation of enhanced for loops: http://www.cis.upenn.edu/~matuszek/General/JavaSyntax/enhanced-for-loops.html
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, if is not a function. It's a statement.
 
guenay oezcan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you both for the advice
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!