Tapestry
Source Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Text

Text manipulation and transformation.

Definitions:

Commands:

  • Capitalize: Copy some text, changing its first letter to uppercase.
  • Find:text: Determine whether one piece of text contains a second piece of text.
  • Is nothing: Determine whether text is completely without content.
  • Is text:expression: Determine whether text matches a regular expression.
  • Is text:prefix: Determine whether text starts in a particular way.
  • Is text:suffix: Determine whether text ends in a particular way.
  • Join[:]parts: Combine text to produce new text.
  • Lower: Copy some text, changing every letter into lowercase.
  • Plural of: Pluralize a word.
  • Reverse text: Copy some text with its contents flipped back to front.
  • Sentence: Copy text, changing the start of each sentence so that it starts with a capital letter.
  • Singular of: Change a plural word into its singular form.
  • Text length: Count the number of characters in some text.
  • Title: Copy some text, making every word start with a capital letter.
  • Upper: Copy some text, changing every letter into uppercase.

Commands

Copy some text, changing its first letter to uppercase.

Slots:

Terms:

Capitalize: TextEval

The text to copy, then capitalize.

Determine whether one piece of text contains a second piece of text.

The [rt.NumEval] version returns the first index at which the text appears, or zero if not found.

Slots:

Terms:

Find: TextEval

The text to search within.

text: TextEval

The text to find.

Determine whether text is completely without content. Even spaces are considered content. The text "" is considered nothing, The text " " is considered something.

Slots:

Terms:

nothing: TextEval

The text to check for content.

Determine whether text matches a regular expression. The expressions used are defined by go. https://pkg.go.dev/regexp/syntax https://github.com/google/re2/wiki/Syntax

Slots:

Terms:

text: TextEval

The text to match the expression against.

expression: Text

The expression to match against the text.

Determine whether text starts in a particular way.

Slots:

Terms:

text: TextEval

The text to search within.

prefix: TextEval

The text to find.

Determine whether text ends in a particular way.

Slots:

Terms:

text: TextEval

The text to search within.

suffix: TextEval

The text to find.

Combine text to produce new text.

Slots:

Terms:

Join: optional TextEval

Optionally, a separator to put between each piece of text.

parts: TextEval repeats

The pieces of text to combine.

Copy some text, changing every letter into lowercase. For example, turns "QUIET" into "quiet.

Slots:

Terms:

Lower: TextEval

The text to copy, then lowercase.

Pluralize a word. The singular form of a word can have more than one plural form. For example: "person" can be "people" or "persons". If more than one exists, this chooses arbitrarily.

Note, The transformation uses predefined rules and some explicit mappings. The story command [DefinePlural] can add new mappings.

Slots:

Terms:

of: TextEval

The text to pluralize.

Copy some text with its contents flipped back to front. For example, turns "Tapestry" into 'yrtsepaT'.

Slots:

Terms:

text: TextEval

The text to copy and then reverse.

Copy text, changing the start of each sentence so that it starts with a capital letter. ( Currently, "sentences" are considered to be a series of characters ending with a full-stop followed by a space. ) For example, "see the doctor run. run doctor. run." into "See the doctor run. Run doctor. Run."

Slots:

Terms:

Sentence: TextEval

The text to copy and then transform.

Change a plural word into its singular form. A plural word only has one singular form. For example, given the word "people", return "person". See [pluralize] for more information.

Slots:

Terms:

of: TextEval

The text to turn into its singular form.

Count the number of characters in some text.

Slots:

Terms:

length: TextEval

The text to measure.

Copy some text, making every word start with a capital letter. For example, turns "empire apple" into "Empire Apple".

Slots:

Terms:

Title: TextEval

The text to copy and then transform.

Copy some text, changing every letter into uppercase. For example, transforms "loud" into "LOUD".

Slots:

Terms:

Upper: TextEval

The text to copy and then transform into uppercase.