tern.string

Highlighting, case conversions, parsing, and more.

Public Imports

tern.algorithm
public import tern.algorithm;
Undocumented in source.

Members

Enums

AnsiColor
enum AnsiColor

Ansi color implementation.

Imports

strip (from std.string)
public import std.string : strip, stripLeft, stripRight;
Undocumented in source.
stripLeft (from std.string)
public import std.string : strip, stripLeft, stripRight;
Undocumented in source.
stripRight (from std.string)
public import std.string : strip, stripLeft, stripRight;
Undocumented in source.

Static functions

highlight
string highlight(AnsiColor color, string matchTo, string matchOf)

Highlights matchOf in matchTo with color.

highlight
string highlight(AnsiColor color, string matchTo, size_t matchStart, size_t matchEnd)

Highlights the string between matchStart and matchEnd in matchTo with color.

isAlpha
bool isAlpha(T c)

Checks if a character is alphabetic.

isAlpha
bool isAlpha(string str)

Checks if a string contains only alphabetic characters.

isAlphaNum
bool isAlphaNum(T c, uint base)

Checks if a character is alphanumeric.

isAlphaNum
bool isAlphaNum(string str, uint base)

Checks if a string contains only alphanumeric characters.

isDigit
bool isDigit(T c, uint base)

Checks if a character is a digit.

isLower
bool isLower(T c)

Checks if a character is lowercase.

isLower
bool isLower(string str)

Checks if a string contains only lowercase characters.

isNumeric
bool isNumeric(string str, uint base)

Checks if a string contains only numeric characters.

isUpper
bool isUpper(T c)

Checks if a character is uppercase.

isUpper
bool isUpper(string str)

Checks if a string contains only uppercase characters.

mangle
string mangle(string str)

Mangles str to remove special characters.

padLeft
string padLeft(string str, size_t length, char padding)

Pads str to the left with padding character until it reaches length.

padRight
string padRight(string str, size_t length, char padding)

Pads str to the right with padding character until it reaches length.

splitLines
string[] splitLines(string str)

Splits str into an array of string lines.

toCamelCase
string toCamelCase(string str)

Converts str to camel case.

toKebabCase
string toKebabCase(string str)

Converts str to kebab case.

toLower
string toLower(string str)

Converts all characters in str to be lowercase.

toLower
T toLower(T c)

Converts a character to lowercase

toPascalCase
string toPascalCase(string str)

Converts str to Pascal case.

toSnakeCase
string toSnakeCase(string str)

Converts str to snake case.

toUpper
string toUpper(string str)

Converts all characters in str to be uppercase.

toUpper
T toUpper(T c)

Converts a character to uppercase.

Meta