Jump to content

Wikifunctions:Catalogue/String operations

From Wikifunctions

These are functions that deal with String (Z6): A sequence of characters, and one of the fundamental Z4/Types available in the Wikifunctions system.

Evaluation

These functions perform simple tests on a text string to tell you if something else needs to be done, or they already are in an expected format.

Empty strings

Case and character types

Other

Properties and metrics

Length

Distance

Get specific characters or substrings

Anywhere in the string

At the start

At the end

Comparison

Comparison functions for String (Z6)
s1 s2
Q110013332
string inequality (Z10379)
s1 s2
Q1332977
has substring (Z10070)
s1 = s2
Q842346
string equality (Z866) s1 s2
Q26161438
case-insensitive string equality (Z10539)
s <empty> is not empty string (Z24331)
s = <empty> is empty string (Z10008) s <empty> is string blank (Z10083)

Equality

Substrings and characters

Length

Transformation

These perform character replacements and other basic operations.

Add characters

To the start and end

To the end (suffix)

If the string doesn't already end with a specific suffix
Language-specific suffixes

Replace characters

Anywhere in the string

At the end (suffix)

Language-specific suffixes

Delete or discard characters

Anywhere in the string

Duplicates

At the start and end

At the start (prefix)

At the end (suffix)

Whitespace

Concatenation and duplication

Case

Formatting and presentation

Other

Regular expressions

Encode and decode

Cryptography

Caesar cipher

(alphabet needs to be specified when calling these functions)

Substitution ciphers

Vigenère cipher

Cryptographic hash functions

(would be better with types representing a stream of bytes)

Wikitext and Mediawiki string operations

Comma-separated values (CSV)

Color operations

Only includes functions that operate on hex triplets. For other color functions, see Wikifunctions:Catalogue/Color functions.

HTML fragments

See Wikifunctions:Catalogue/HTML operations