❔ Text file
So I am wondering how this works, so I am calling a textfile and then splitting it into multiple and checking if the user input is anywhere in the textfile but havent done it because I dont really understand how and if the split function works for multiple lines
and my code wouldnt fit so
https://wtools.io/paste-code/bJ6z
WEB Tools
updated text code
using System; using System.Collections.Generic; using System.IO; using System.IO.Pipes; using System.Linq; using System.Runtime.Remoting.Met
9 Replies
i updated it, i have all the split variables in one so can i call it from outside to get the user input and check if it matches anay\
So what exactly is your question? You're on the right path, but I would prefer to not use
foreach
personally.so i was hoping to split the text file with ; and ask a user to input the appliance id whichis the first part of the text file the numbers and if that number is in then it will say accepted and if not it will say rejected
Consider making a class or record to represent each appliance instead of just using a bunch of free floating variables.
Then you can put those into some data structure to allow lookup by various attributes.
A
List<Appliance>
being a simple starting point if you know the data will not be large.
kinda like this?
or remove it from foreach?
...well that's not a thing
Do you know how classes work?
kinda
oh so we gotta call one of the classes made and not a new one
so appliance
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.