Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

How to return the last element in a txt file C#

$
0
0

I have a text file that will basically be something like what is shown below. I would like to return just the last element if the first 2 element matches.

$fruit#color#type#smell#qty $fruit#color#type#smell#qty $fruit#color#type#smell#qty 

So this is what i kinda came up with. I would like to return the last element qty into result. Just wondering if it is possible to do it with an if else statement and how can i achieve it.

if (store.Contains(fruit+#+color))
             {
                  result=
             }



Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>