• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can indexof look at an array of Strings  RSS feed

 
Ranch Hand
Posts: 1785
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following but was wondering if the strings could be combined into an array and only one if be used?

 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably can, but I am not sure what you want.
 
Steve Dyke
Ranch Hand
Posts: 1785
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:You probably can, but I am not sure what you want.


Would like something like:

 
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do that, but you could do something like
 
Steve Dyke
Ranch Hand
Posts: 1785
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stuart A. Burkett wrote:You can't do that, but you could do something like


Thanks, works great.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!