pystr_zfill: Zero-pad a string.

Description Usage Arguments Details Value References Examples

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)

pystr documentation built on April 15, 2017, 12:30 a.m.

Search within the pystr package
Search all R packages, documentation and source code