Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ltrim(), rtrim(), and trim() in awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
BEGIN {
# whatever
}
{
# whatever
}
END {
# whatever
}
@andyxning
Copy link

andyxning commented Aug 19, 2015

awesome!

@elgholm
Copy link

elgholm commented Sep 22, 2015

Thx!

@islamouahouda
Copy link

islamouahouda commented Mar 5, 2016

Thanks great work !

@michto01
Copy link

michto01 commented Nov 3, 2016

Thx!

@luisco
Copy link

luisco commented Jun 8, 2017

Excellent, thanks

@moijes12
Copy link

moijes12 commented Aug 26, 2017

Thanks 👍

@kdcc
Copy link

kdcc commented Feb 27, 2018

Fantastic! @

@RezoApio
Copy link

RezoApio commented Mar 5, 2018

Really useful! Thanks a lot

@noobbbbb
Copy link

noobbbbb commented Jul 31, 2018

Thx!

@LeeYunhang
Copy link

LeeYunhang commented Sep 10, 2018

Thank you very much, man.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment