Series.str.trim

Remove leading and trailing Whitespace from a String element

danfo.Series.str.trim(options) [source]

ParametersTypeDescriptionDefault

options

Object

inplace: Whether to perform the operation in-place or not.

{

inplace: false

}

Returns:

**** return Series

const dfd = require("danfojs-node")

let data = ['lower part ', ' CAPITALS city', ' this is a sentence', '  SwAp CaSe']
let sf = new dfd.Series(data)
sf.str.trim().print()
╔═══╤══════════════════════╗
║   │ 0                    ║
╟───┼──────────────────────╢
║ 0 │ lower part           ║
╟───┼──────────────────────╢
║ 1 │ CAPITALS city        ║
╟───┼──────────────────────╢
║ 2 │ this is a sentence   ║
╟───┼──────────────────────╢
║ 3 │ SwAp CaSe            ║
╚═══╧══════════════════════╝

Last updated