Sorting an Array from one RichTextBox to another RichTextBox using a Button Click Event
okay here issue , have tried numerous different codes. pulled text text file , put richtextbox array. trying array , sort if alphabetically in second richtextbox using button. understanding need pass array argument , can perform sort. can't figure out. @ loss on how array original rich textbox , after sort display in second richtextbox. read shows how sort , display in 1 method example create array, sort array, display array.
i tried method/code:
var sort = s in array
orderby s
select s;
foreach (string c in sort)
{
array = richtxtsort.text;
}
}
public ienumerable<string> array { get; set; }
and one
array.sort(array); foreach (string s in array) { console.writeline(s); }
ejaramillo
you can , set richtextbox text using lines property. bear in mind copy text, not special formatting fonts or colours.
string[] lines = richtextbox1.lines; var sort = s in lines orderby s select s; richtextbox2.lines = sort.toarray();
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment