This is the documentation page for Module:String2
This is a documentation subpage for 'Module:String2'.
It contains usage information, categories, and other content that is not part of the original module page.
Function list |
---|
L 37 — prefix_strip L 171 — v2p L 253 — p._escapePattern L 275 — p.strip L 305 — p.matchAny L 334 — p.hyphen_to_dash L 371 — p.hyphen2dash L 379 — p.startswith |
This module is a helper module to be used by other modules; it may not designed to be invoked directly. See Star Citizen:Lua/Helper modules for a full list and more information.
Function | Type | Use |
---|---|---|
trim | Trims whitespace characters from the start and end of the string. | |
title | Capitalizes the first letter of each word in the text, apart from a number of short words: a, an, the, at, by, for, in, of, on, to, up, and, as, but, or, and nor. | |
sentence | Finds the first letter and capitalises it, then renders the rest of the text in lower case. | |
ucfirst | Finds the first letter and capitalises it, then renders the rest of the text in lower case. | |
findlast | Finds the last item in a list | |
split | Splits text at boundaries specified by separator and returns the chunk for the index idx (starting at 1). | |
stripZeroes | Finds the first number in a string of text and strips leading zeros, but retains a zero which is followed by a decimal point. For example: "0940" → "940"; "Year: 0023" → "Year: 23"; "00.12" → "0.12" | |
nowiki | Ensures that a string of text is treated by the MediaWiki software as just a string, not code. It trims leading and trailing whitespace. | |
val2percent | Scans through a string, passed as either the first unnamed parameter or | |
one2a | Scans through a string, passed as either the first unnamed parameter or | |
findpagetext | Returns the position of a piece of text in the wikitext source of a page. | |
strip | Strips the first positional parameter of the characters or pattern supplied in the second positional parameter. | |
matchAny | Returns the index of the first positional parameter to match the source parameter. | |
hyphen2dash | Converts a hyphen to a dash under certain conditions. The hyphen must separate like items; unlike items are returned unmodified. | |
startswith | Match strings start with a pattern |