Powered By GitBook
Series.str.capitalize
Capitalize the first character of each string
danfo.Series.str.capitalize(options) [source]
Parameters
Type
Description
Default
options
Object
inplace: Whether to perform the operation in-place or not.
{
inplace: false
}
Returns: Series (String element)
Example
Convert the first character of a string to capital letter
Node
Browser
1
const dfd = require("danfojs-node")
2
3
let data = ['lower boy', 'capitals', 'sentence', 'swApCaSe']
4
let sf = new dfd.Series(data)
5
sf.str.capitalize().print()
Copied!
1
Copied!
Output
1
╔═══╤══════════════════════╗
2
║ │ 0 ║
3
╟───┼──────────────────────╢
4
║ 0 │ Lower boy ║
5
╟───┼──────────────────────╢
6
║ 1 │ Capitals ║
7
╟───┼──────────────────────╢
8
║ 2 │ Sentence ║
9
╟───┼──────────────────────╢
10
║ 3 │ Swapcase ║
11
╚═══╧══════════════════════╝
Copied!
Last modified 24d ago
Copy link