Add line sorting to string utils - #835
Merged
Merged
Conversation
celluj34
reviewed
Jun 5, 2023
celluj34
reviewed
Jun 5, 2023
|
|
||
| viewModel.RandomizeCommand.Execute(null); | ||
|
|
||
| // Can't guarantee the order, just make sure everything is still there |
There was a problem hiding this comment.
An interface could be introduced, then we could mock and guarantee results, something like https://stackoverflow.com/a/311829/17052649 if that's acceptable.
Author
There was a problem hiding this comment.
Not a bad idea. I hadn't dived into how DI is set up, so I wasn't sure if I could inject the real Random though the constructor. Also thought it might be a bit overkill. I guess I'll leave this one up to the maintainer.
celluj34
reviewed
Jun 5, 2023
celluj34
reviewed
Jun 5, 2023
veler
reviewed
Jun 5, 2023
veler
reviewed
Jun 5, 2023
veler
approved these changes
Jun 8, 2023
veler
left a comment
Collaborator
There was a problem hiding this comment.
Approved. Thank you again for this improvement!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: #232
What is the new behavior?
Add the following functions to the string utilities tool. These operate on lines of text.
DevToys-Alphabetize-Demo.mp4
Other information
All of the line splitting is done on CR (
\r). I noticed that this is the line separator used for typed text and loaded files using any line endings (CR, LF,"or or CRLF). I don't really understand why, but it seems consistent.For sorting by last word, I'm splitting on space and also comma (to accommodate CSV and last,first formatting).
It might be ever so slightly confusing that the "Original text" button is under the "Convert" heading. Maybe we could consider making it a highlighted/action button.
Quality check
Before creating this PR: