Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » strings and nets » pad
next | previous | forward | backward | up | index | toc

# pad -- pad a string or net with spaces

- Usage:
    `pad(s,n)`
    `pad(n,s)`
- Inputs:
  - s, a net,
  - n, an integer,

## Description

pad(s,n) pads the string or net s to length n with spaces on the right.

pad(n,s) pads the string or net s to length n with spaces on the left.

    i1 : pad(6, "foo")

    o1 =    foo

    i2 : pad("foo", 6) | "bar"

    o2 = foo   bar

## Ways to use pad:

- `pad(Net,ZZ)`
- `pad(String,ZZ)`
- `pad(ZZ,Net)`
- `pad(ZZ,String)`

## For the programmer

The object pad is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_strings.m2:519:0.