unexpand

unexpand (

text

)

Give an array of strings ( text ), that may or may not contain tabs, replaces each $tabstop consecutive spaces with a tab character.