Remove All Whitespace in Julia

Published on 05 October 2022 (Updated: 05 October 2022)

Welcome to the Remove All Whitespace in Julia page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

using Core: print
function err()
  println("Usage: please provide a string")
end

function remove_all_whitespaces(n)
  if (length(n) in [0,1])
    err()
  else
    n_nospace = (filter(x -> !isspace(x), n))
    n_notab = replace(n_nospace,  "\t" => "")
    n_nonewline = replace(n_notab,  "\n" => "")
    n_nonewline = replace(n_notab,  "\r" => "")
    println(n_nonewline)
  end
end

try
  # remove_all_whitespaces(parse(ARGS[1]))
  remove_all_whitespaces(ARGS[1])
catch e
  err()
end

Remove All Whitespace in Julia was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.