util
Other random utilities
Import
_ <- fat.extra.util
Constants
- regex, named import of regex library
Methods
Name | Signature | Brief |
---|---|---|
inferType | (x: Text): Any | Convert text to boolean, number or keep as text |
fillWith | (fill: Text, n: Number): Text | Create text with n of fill elements |
padRight | (x: Text, fill: Text, n: Number): Text | Add up to n of fill elements to the right-side of x |
padLeft | (x: Text, fill: Text, n: Number): Text | Add up to n of fill elements to the left-side of x |
Usage Notes
text padding
Methods for text formatting/padding purposes, use like:
padRight('Label', ' ', 10) # Text: 'Label '
padLeft('45', '0', 6) # Text: '000045'
if size of text is bigger than
n
, no transformation is performed