Updated text.lua with some functions suggested (and a few fully implemented) by
@Pablostuka.
-- text.lpad(str,length,character) --> string | By Pablostuka
-- pad "character" to the left of string "str" to max of "lenght" by Pablostuka
-- text.rpad(str,length,character) --> string | By Pablostuka
-- pad "character" to the right of string "str" to max of "lenght"
-- text.pad(str,length,character) --> string | By Pablostuka
-- pad "character" on both sides of string "str" to max of "lenght"
-- text.international(string) --> string | inspired by Pablostuka,
-- text.i(string) --> string (alias for text.international)
-- substitutes extended ascii characters for the correct character
-- (I'm pretty sure this is a formatting issue, where the text editor
-- shows an extended ascii character, but records it as 2 characters,
-- so a formatting change might also be effective, but this is still
-- likely to be a quick fix in many circumstances)
-- text.upper(string) --> string
-- Makes string uppercase, including uppercasing the international characters
-- from the extended ASCII table
-- if you don't use international characters, string.upper is fine
-- text.lower(string) --> string
-- Makes string lowercase, including lowercasing the international characters
-- from the extended ASCII table
-- if you don't use international characters, string.lower is fine
-- text.iUpper(string) --> string
-- fixes international characters and makes string upper case
-- text.iLower(string) --> string
-- fixes international characters and makes string lower case
Many of these deal with non-English characters discussed
here. text.international (text.i for short) deals with a formatting issue for some text editors. It seems that special characters are sometimes saved as 2 characters but shown as the single special character by the text editor. text.international converts those pairs of characters to the single correct character when the script is loaded (assuming all text editors behave the same way as mine). This function may be more convenient than a format change, and will certainly be easier to explain as a fix.
The text.lower and text.upper functions do the same thing as string.lower and string.upper, but also capitalise or lowercase the non-English special characters. text.iLower, and text.iUpper internationalise and upper/lower the string in one function, which some people may find useful.