Expand tab characters to fixed column stops.
Numeric.string.pad(text, width = 8)Replaces tab stops with spaces up to the width.
- Parameters:
text: String or array of strings to expandwidth: Column width of each tab stop
- Returns: Expanded strings matching the input shape
- NumPy: Covers
np.strings.expandtabs,np.char.expandtabsthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const value = Numeric.string.pad('a\tb', 8)
console.log(value)
// a bimport Numeric from '@neabyte/numerix'
const value = Numeric.string.pad('a\tb', 4)
console.log(value)
// a bimport Numeric from '@neabyte/numerix'
const value = Numeric.string.pad('ab', 8)
console.log(value)
// abimport Numeric from '@neabyte/numerix'
const values = Numeric.string.pad(['a\tb', 'c\td'], 4)
console.log(values)
// ["a b","c d"]