pystr_zfill: Zero-pad a string.

Description Usage Arguments Details Value References Examples

View source: R/pystr_zfill.R

Description

Return a copy of the string left filled with ASCII '0' digits to make a string of length width.

Usage

1

Arguments

str

A character vector.

width

An integer.

Details

A leading sign prefix (+/-) is handled by inserting the padding after the sign character rather than before. The original string is returned if width is less than or equal to nchar(str).

Value

A character vector.

References

https://docs.python.org/3/library/stdtypes.html#str.zfill

Examples

1
2
3
pystr_zfill("42", 5)
pystr_zfill("-42", 5)
pystr_zfill("+42", 5)

nicolewhite/pystr documentation built on May 23, 2019, 5:09 p.m.