C
C#2y ago
masherinc

✅ Check a param againstt a string

I'm creating a sort of Animal Dictionary and I need help with check if the name param in the AddToSearchHistory() method matches the Labels() name param. Of course I could do what I'm doing now and check against a certain string, but I'm creating a dictionary and I would have to check against alot of strings. I could also evoke the AddToSearchHistory() method to the labels() if statement, but I'm pretty sure that would cause a big file. I've tried making the Labels() params public, but that just caused my whole programm to break. Any Suggestions? https://pastebin.com/5nh89DD2
Pastebin
Checking if nameproperty maching string in method - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
3 Replies
Connor
Connor2y ago
This code seems very odd to me I have no idea what you’re trying to do with this code
masherinc
masherincOP2y ago
Well, I followed a tut for c# OOP and now I'm trying to make my own OOP by creating a table of Animal types, sounds and actions and them outputing that table to the console. I can output the table just fine, the problem is whenever I have "eeeeeeeeee" as the first arguement for the msain method(the Animals() method) it outputs a table, but since "eeeeee" isnt a name of an actual animal, tthen it shoundnt output a table
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server