Click here to Skip to main content
15,887,822 members
Home / Discussions / C#
   

C#

 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440817-Jul-17 20:18
Member 1329440817-Jul-17 20:18 
AnswerRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier17-Jul-17 21:33
mveRalf Meier17-Jul-17 21:33 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Member 1329440828-Jul-17 0:25
Member 1329440828-Jul-17 0:25 
GeneralRe: Text file search, combobox and Datagridview C# Help Pin
Ralf Meier28-Jul-17 0:26
mveRalf Meier28-Jul-17 0:26 
AnswerRe: Text file search, combobox and Datagridview C# Help Pin
BillWoodruff5-Jul-17 21:44
professionalBillWoodruff5-Jul-17 21:44 
QuestionIs this madness? The pursuit of single-statement methods Pin
Kevin Li (Li, Ken-un)4-Jul-17 10:13
Kevin Li (Li, Ken-un)4-Jul-17 10:13 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
PIEBALDconsult4-Jul-17 10:21
mvePIEBALDconsult4-Jul-17 10:21 
SuggestionRe: Is this madness? The pursuit of single-statement methods Pin
Richard Deeming4-Jul-17 11:09
mveRichard Deeming4-Jul-17 11:09 
The first method is a good example of "evil" comments - they just repeat the code in different words. Smile | :)

Fighting Evil in Your Code: Comments on Comments - Simple Talk[^]


I'd be inclined to move the final Aggregate to its own extension method - JoinLines perhaps? You can also simplify it by using String.Join[^]:
C#
public static string JoinLines(this IEnumerable<string> lines) => string.Join(Environment.NewLine, lines);

C#
void RemoveDuplicatesButton_Click(object sender, RoutedEventArgs e) => this.InputTextBox.Text = this.InputTextBox.Text.SplitLines().Unique().JoinLines();




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Is this madness? The pursuit of single-statement methods Pin
Pete O'Hanlon5-Jul-17 4:44
mvePete O'Hanlon5-Jul-17 4:44 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
Marc Clifton4-Jul-17 11:26
mvaMarc Clifton4-Jul-17 11:26 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
Bernhard Hiller4-Jul-17 21:31
Bernhard Hiller4-Jul-17 21:31 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
ScottM14-Jul-17 22:49
ScottM14-Jul-17 22:49 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
Pete O'Hanlon5-Jul-17 1:08
mvePete O'Hanlon5-Jul-17 1:08 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
Pete O'Hanlon5-Jul-17 4:20
mvePete O'Hanlon5-Jul-17 4:20 
GeneralRe: Is this madness? The pursuit of single-statement methods Pin
Rob Philpott5-Jul-17 23:22
Rob Philpott5-Jul-17 23:22 
GeneralRe: Is this madness? The pursuit of single-statement methods Pin
Pete O'Hanlon6-Jul-17 0:04
mvePete O'Hanlon6-Jul-17 0:04 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
Gerry Schmitz5-Jul-17 5:13
mveGerry Schmitz5-Jul-17 5:13 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
jschell5-Jul-17 6:28
jschell5-Jul-17 6:28 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
Eddy Vluggen5-Jul-17 7:56
professionalEddy Vluggen5-Jul-17 7:56 
AnswerRe: Is this madness? The pursuit of single-statement methods Pin
BillWoodruff6-Jul-17 0:03
professionalBillWoodruff6-Jul-17 0:03 
GeneralRe: Is this madness? The pursuit of single-statement methods Pin
Rob Philpott6-Jul-17 0:26
Rob Philpott6-Jul-17 0:26 
GeneralRe: Is this madness? The pursuit of single-statement methods Pin
BillWoodruff6-Jul-17 0:55
professionalBillWoodruff6-Jul-17 0:55 
GeneralRe: Is this madness? The pursuit of single-statement methods Pin
Richard Deeming6-Jul-17 1:30
mveRichard Deeming6-Jul-17 1:30 
GeneralRe: Is this madness? The pursuit of single-statement methods Pin
BillWoodruff6-Jul-17 2:29
professionalBillWoodruff6-Jul-17 2:29 
GeneralRe: Is this madness? The pursuit of single-statement methods Pin
Rob Philpott6-Jul-17 3:22
Rob Philpott6-Jul-17 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.