Remove All Whitespace in Awk (original) (raw)
Sample Programs in Every Language
A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Published on 14 April 2025 (Updated: 16 April 2025)
Welcome to the Remove All Whitespace in Awk page! Here, you'll find the source code for this program as well as a description of how the program works.
Current Solution
function usage() {
print "Usage: please provide a string"
exit(1)
}
function remove_whitespace(s, arr, result) {
split(s, arr, /\s+/)
result = ""
for (k in arr) {
result = result arr[k]
}
return result
}
BEGIN {
if (ARGC < 2 || !ARGV[1]) {
usage()
}
print remove_whitespace(ARGV[1])
}
Remove All Whitespace in Awk was written by:
- rzuckerm
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.