LitDev Extension API
LDText
Text manipulations.
BS | Compare | CR |
DQ | FastStringAppend | FastStringClear |
FastStringGet | FastStringNew | FindAll |
GetHeight | GetWidth | LF |
Replace | Split | SQ |
TAB | Trim |
BS
Get the back space character
Compare(text1,text2)
Lexically compare 2 text strings, the comparison is case insensitive and culture invariant.
text1 The first string to compare.
text2 The second string to compare.
returns An integer:
less than zero (text1 is less than text2)
zero (strings are equal)
greater than zero (text1 is greater than text2)
CR
Get the carriage return character \r
DQ
Get the double quote character "
FastStringAppend(fastString,text)
Append a string value to a fast string object.
fastString A fast string object.
text The test to append.
FastStringClear(fastString)
Reset a fast string object to "".
fastString A fast string object.
FastStringGet(fastString)
Get the current text in a fast string.
fastString A fast string object.
returns The current fast string text.
FastStringNew()
Create a new fast string appending object.
returns The fast string append object.
FindAll(text,find)
Get all occurances of a subtext in some text.
text The text to search.
find The subtext to search for.
returns An array with the positions of the start of each subtext or 0 for none.
GetHeight(text)
Get the height in pixels that text will be displayed in the GraphicsWindow with the current font.
The GraphicsWindow must be open to use this method.
text The text to get the height.
returns The width in pixels.
GetWidth(text)
Get the width in pixels that text will be displayed in the GraphicsWindow with the current font.
The GraphicsWindow must be open to use this method.
text The text to get the width.
returns The width in pixels.
LF
Get the line feed (newline) character \n
Replace(text,find,replace)
Find and Replace all occurances of one text with another.
text A text to modify.
find The text to find and replace.
replace The text to replace the found text.
returns A modified copy of the input text.
Split(text,separator)
Split a variable into an array delimiated by a separator.
text A text string to split.
separator A separator string (e.g. " "), or an array of separator strings.
returns A result array of deliminated texts.
SQ
Get the single quote character '
TAB
Get the back tab character \t
Trim(text)
Return a string with all leading and trailing 'white space' removed.
text A string to trim.
returns A trimmed copy of the input string.