onespace(
onespace(
TEXT
)

The onespace( function removes all leading & trailing spaces and any extra spaces between words, so that there is exactly one and only one space between each word.

Parameters

This function has one parameter:

text – the original text.

Description

This function removes all leading & trailing spaces and any extra spaces between words, so that there is exactly one and only one space between each word.

    onespace("     now is   the        time") ☞ now is the time

See also the onewhitespace( function, which also removes extra line breaks and tabs between words.

Note: This function is equivalent to:

    arraystrip(thetext," ")

See Also

- appendluhncheckdigit( -- adds a Luhn check digit to a series of digits.
- characterfilter( -- scans and filters text on a character by character basis.
- concatenate( -- concatenates two text strings (same as the + operator).
- connect( -- appends a prefix and suffix together with a connector in between.
- crtovtab( -- converts carrige returns (ASCII 0x0D) into vertical tabs (ASCII 0x0B).
- csvtotsv( -- converts comma separated text into tab separated text.
- defaulttext( -- returns a text value, or returns a default value if the text value is empty ("").
- fixedwidth( -- makes the text a fixed width, padding with spaces if necessary.
- fixedwidthright( -- makes the text a fixed width, padding on the left with spaces if necessary.
- linesort( -- sorts lines of text in ascending order.
- linestrip( -- removes any blank lines from the text.
- lower( -- converts text to lower case.
- makemergeformula( -- builds a formula from an “auto-wrap" style merge template.
- mixedupperword( -- converts lower case words to Initial Caps, but leaves mixed case words alone.
- obscuredigits( -- obscures digits in a number (usually a credit card number) with Xs.
- onewhitespace( -- removes all leading spaces and any extra whitespace between words, making sure that there is one and only one space between each word.
- padzero( -- makes the text a fixed width, padding on the left with zeros if necessary.
- quoted( -- returns a quoted version of the supplied text.
- removeprefix( -- checks to see if a text item starts with a prefix. if it does, the prefix is removed.
- removesuffix( -- checks to see if a text item ends with a suffix. if it does, the suffix is removed.
- rep( -- assembles a text item by repeating a smaller text item over and over again.
- replace( -- replaces text with new text.
- replacefirst( -- replaces the first occurence of some text with new text.
- replacemultiple( -- replaces multiple words and phrases in a text value.
- replaceword( -- replaces a word with a new word.
- replacewordexact( -- replaces a word with a new word.
- sandwich( -- assembles a text item from three smaller items.
- snip( -- removes (snips!) one or more characters from the middle of an item of text.
- straightquotes( -- converts any "smart quotes" in the text into straight quotes.
- stripaccents( -- removes accents from any characters in the text.
- stripchar( -- extracts characters you don't want from a text item.
- stripdiacriticals( -- strips diacritical marks from text.
- stripprintable( -- strips non-printable characters from text.
- striptoalpha( -- removes everything but alphabetic letters from a text item.
- striptonum( -- removes everything but numeric digits from a text item.
- textfilter( -- scans and filters text on a character by character basis.
- textstuff( -- replaces one or more characters in the middle of a piece of text.
- titlecase( -- capitalizes first character of each word, but not articles, prepositions, and conjunctions under 5 characters (unless they are the first or last word in the text).
- trimstart( -- removes one or more characters from the start of the text.
- upper( -- converts text to UPPER CASE (all caps).
- upperword( -- converts text to Initial Caps.
- vtabtocr( -- converts vertical tabs (ASCII 0x0B) into carrige returns (ASCII 0x0D).
- yoke( -- appends two text items together, with a joiner between them if both are non-blank.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0.