Reimplement pad for string.

This commit is contained in:
Stephen Chung
2020-10-18 22:36:58 +08:00
parent ea814779bf
commit 25f820f5bf
7 changed files with 150 additions and 97 deletions

View File

@@ -9,7 +9,7 @@ using a [raw `Engine`]) operate on [strings]:
| Function | Parameter(s) | Description |
| ------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `len` method and property | _none_ | returns the number of characters (not number of bytes) in the string |
| `pad` | 1) character to pad<br/>2) target length | pads the string with an character to at least a specified length |
| `pad` | 1) target length<br/>2) character/string to pad | pads the string with a character or a string to at least a specified length |
| `+=` operator, `append` | character/string to append | Adds a character or a string to the end of another string |
| `clear` | _none_ | empties the string |
| `truncate` | target length | cuts off the string at exactly a specified number of characters |