-
-
Notifications
You must be signed in to change notification settings - Fork 627
Add Remove All Whitespace in R #5130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d6be41f
447c47b
4f9ae7e
838b73d
b34783e
3c001b1
1c296ea
0017c93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Remove all white spaces | ||
| args <- commandArgs(trailingOnly = TRUE) | ||
|
|
||
| if (length(args) == 0 || args[1] == "" || is.null(args[1]) ){ | ||
| cat("Usage: please provide a string") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this should have a newline attached to it since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I withdraw this request Sir. I am not able to do this with R Code. |
||
| } | ||
|
|
||
| cleaned_sentence <- gsub("\\s+", "", args[1]) | ||
|
|
||
| cat (cleaned_sentence) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking for is.null is redundant, since length(args) == 0 checks that case already.