Get all the values between lower and upper value
i'm not sure, if question unique, couldn't find answer looking for.
want way values within lower value , upper value in c#, , want have list of values richtextbox1.
example; lower value=apple28 , upper value=apple31. result this:
apple28
apple29
apple30
apple31
*if list have apple15 not in list because it's outside lower value , apple60 not in list because outside upper value. code load values within range list.
want code search values in external .txt file trough openfiledialog1 , values richtextbox1. not important, can find myself. need code find values within lower , upper value.
know should try first believe me tried many times , failed. i new hope can show me.
regards
matthew's approach that.
or @ least think does, put version append in 1 statement.
why?
because like messing code.
private void button1_click(object sender, eventargs e) { if (openfiledialog1.showdialog() != dialogresult.ok) return; string start = "apple28"; string end = "apple31"; richtextbox1.appendtext( string.join("", file.readlines(openfiledialog1.filename) .where(x => x.compareto(start) >= 0 && x.compareto(end) <= 0) .select(x => x + "\n") .toarray())); }
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment