This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to change an integer search method to look for strings - any help  RSS feed

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm writing a class, which currently includes a search method for finding integer variables within a text file. I need to change this to find strings in the same text file. I've tried changing this method, but have had no luck so far. The current code for the search method is as follows,

The constructors for this class are currently,

Any advice or help on how to change the above search method to allow me to search for strings as well as integers much appreciated.
 
celine scarlett
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem.

I've managed to sort this one out by myself. I realised that the search method had nothing to actually search, and that was why Null was being returned. I therefore created an array of TitleList type in the main class, and allowed the search method access to the details.

All works perfectly now.
 
Don't touch me. And dont' touch this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!