mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-08-03 02:56:53 -04:00
4
API Text
Vexatos edited this page 2014-07-13 05:29:03 -07:00
For those that don't like images: the wiki has moved to a new place, http://ocdoc.cil.li/.
This wiki will no longer be updated.
This API provides some more general operations on strings and data serialization into and back from strings.
text.detab(value: string, tabWidth: number): string
Converts tabs in a string to spaces, while aligning the tags at the specified tab width. This is used for formatting text interm.write
, for example.text.padRight(value: string, length: number): string
Pads a string with whitespace on the right up to the specified length.text.padLeft(value: string, length: number): string
Pads a string with whitespace on the left up to the specified length.text.trim(value: string): string
Removes whitespace characters from the start and end of a string.text.serialize(value: any except functions): string
Deprecated, use [[serialization.serialize
|API/Serialization]].text.unserialize(value: string): any
Deprecated, use [[serialization.unserialize
|API/Serialization]].