Text

Methods
12
Fields
1

Methods

MethodReturnsDescription
removeTags(string)stringThe string without its <...> tags; <lt>/<gt> become </>.
fromCSV(string){string}The comma-separated values, each trimmed, empty ones dropped.
toCSV({string})stringThe strings joined by ,.
toJagexName(string)stringA player name as Jagex spells it: printable characters, non-breaking spaces as spaces.
sanitize(string)stringA player name without tags and with non-breaking spaces as spaces.
titleCase(any)stringAn enum constant's name as This Format, unless its toString is its own. Takes any enum constant.
escapeJagex(string)string< as <lt>, > as <gt>, a newline as <br>, carriage returns dropped.
unescapeJagex(string)stringThe inverse of escapeJagex.
sanitizeMultilineText(string)stringMultiline widget text as one line: <br> as a space, tags removed.
standardize(string)stringTags removed, lower case, trimmed: for comparing names.
removeFormattingTags(string)stringOnly the formatting tags removed (<col>, <br>, ...); <img> kept.
matchesSearchTerms({string}, {string})booleanWhether every term is in, or within a Jaro-Winkler similarity of 0.9 of, some keyword.

Fields

FieldTypeDescription
JAGEX_PRINTABLE_CHAR_MATCHERCharMatcherThe characters the game's fonts draw (U+0020-U+007E, U+0080, U+00A0-U+00FF), as a CharMatcher: `Text.JAGEX_PRINTABLE_CHAR_MATCHER:retainF…

Method details

removeTags

removeTags: (string) -> string

The string without its <...> tags; <lt>/<gt> become </>.

fromCSV

fromCSV: (string) -> {string}

The comma-separated values, each trimmed, empty ones dropped.

toCSV

toCSV: ({string}) -> string

The strings joined by ,.

toJagexName

toJagexName: (string) -> string

A player name as Jagex spells it: printable characters, non-breaking spaces as spaces.

sanitize

sanitize: (string) -> string

A player name without tags and with non-breaking spaces as spaces.

titleCase

titleCase: (any) -> string

An enum constant's name as This Format, unless its toString is its own. Takes any enum constant.

escapeJagex

escapeJagex: (string) -> string

< as <lt>, > as <gt>, a newline as <br>, carriage returns dropped.

unescapeJagex

unescapeJagex: (string) -> string

The inverse of escapeJagex.

sanitizeMultilineText

sanitizeMultilineText: (string) -> string

Multiline widget text as one line: <br> as a space, tags removed.

standardize

standardize: (string) -> string

Tags removed, lower case, trimmed: for comparing names.

removeFormattingTags

removeFormattingTags: (string) -> string

Only the formatting tags removed (<col>, <br>, ...); <img> kept.

matchesSearchTerms

matchesSearchTerms: ({string}, {string}) -> boolean

Whether every term is in, or within a Jaro-Winkler similarity of 0.9 of, some keyword.

Field details

JAGEX_PRINTABLE_CHAR_MATCHER

JAGEX_PRINTABLE_CHAR_MATCHER: CharMatcher

The characters the game's fonts draw (U+0020-U+007E, U+0080, U+00A0-U+00FF), as a CharMatcher: Text.JAGEX_PRINTABLE_CHAR_MATCHER:retainFrom(s) keeps only those, as the chat filter does to every message. One instance, the same every read.