class TextData (View source)

Methods

static string
CHARACTER(string $character)

CHARACTER.

static string
TRIMNONPRINTABLE(mixed $stringValue = '')

TRIMNONPRINTABLE.

static string
TRIMSPACES(mixed $stringValue = '')

TRIMSPACES.

static int
ASCIICODE(string $characters)

ASCIICODE.

static string
CONCATENATE(...$args)

CONCATENATE.

static string
DOLLAR(float $value = 0, int $decimals = 2)

DOLLAR.

static string
SEARCHSENSITIVE(string $needle, string $haystack, int $offset = 1)

SEARCHSENSITIVE.

static string
SEARCHINSENSITIVE(string $needle, string $haystack, int $offset = 1)

SEARCHINSENSITIVE.

static string
FIXEDFORMAT(mixed $value, int $decimals = 2, bool $no_commas = false)

FIXEDFORMAT.

static string
LEFT(string $value = '', int $chars = 1)

LEFT.

static string
MID(string $value = '', int $start = 1, int $chars = null)

MID.

static string
RIGHT(string $value = '', int $chars = 1)

RIGHT.

static int
STRINGLENGTH(string $value = '')

STRINGLENGTH.

static string
LOWERCASE(string $mixedCaseString)

LOWERCASE.

static string
UPPERCASE(string $mixedCaseString)

UPPERCASE.

static string
PROPERCASE(string $mixedCaseString)

PROPERCASE.

static string
REPLACE(string $oldText, int $start, int $chars, string $newText)

REPLACE.

static string
SUBSTITUTE(string $text = '', string $fromText = '', string $toText = '', int $instance = 0)

SUBSTITUTE.

static null|string
RETURNSTRING(mixed $testValue = '')

RETURNSTRING.

static string
TEXTFORMAT(mixed $value, string $format)

TEXTFORMAT.

static bool
VALUE(mixed $value = '')

VALUE.

static float|string
NUMBERVALUE(mixed $value = '', string $decimalSeparator = null, string $groupSeparator = null)

NUMBERVALUE.

static bool
EXACT($value1, $value2)

Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.

static string
TEXTJOIN(mixed $delimiter, mixed $ignoreEmpty, mixed ...$args)

TEXTJOIN.

Details

static string CHARACTER(string $character)

CHARACTER.

Parameters

string $character Value

Return Value

string

static string TRIMNONPRINTABLE(mixed $stringValue = '')

TRIMNONPRINTABLE.

Parameters

mixed $stringValue Value to check

Return Value

string

static string TRIMSPACES(mixed $stringValue = '')

TRIMSPACES.

Parameters

mixed $stringValue Value to check

Return Value

string

static int ASCIICODE(string $characters)

ASCIICODE.

Parameters

string $characters Value

Return Value

int

static string CONCATENATE(...$args)

CONCATENATE.

Parameters

...$args

Return Value

string

static string DOLLAR(float $value = 0, int $decimals = 2)

DOLLAR.

This function converts a number to text using currency format, with the decimals rounded to the specified place. The format used is $#,##0.00_);($#,##0.00)..

Parameters

float $value The value to format
int $decimals The number of digits to display to the right of the decimal point. If decimals is negative, number is rounded to the left of the decimal point. If you omit decimals, it is assumed to be 2

Return Value

string

static string SEARCHSENSITIVE(string $needle, string $haystack, int $offset = 1)

SEARCHSENSITIVE.

Parameters

string $needle The string to look for
string $haystack The string in which to look
int $offset Offset within $haystack

Return Value

string

static string SEARCHINSENSITIVE(string $needle, string $haystack, int $offset = 1)

SEARCHINSENSITIVE.

Parameters

string $needle The string to look for
string $haystack The string in which to look
int $offset Offset within $haystack

Return Value

string

static string FIXEDFORMAT(mixed $value, int $decimals = 2, bool $no_commas = false)

FIXEDFORMAT.

Parameters

mixed $value Value to check
int $decimals
bool $no_commas

Return Value

string

static string LEFT(string $value = '', int $chars = 1)

LEFT.

Parameters

string $value Value
int $chars Number of characters

Return Value

string

static string MID(string $value = '', int $start = 1, int $chars = null)

MID.

Parameters

string $value Value
int $start Start character
int $chars Number of characters

Return Value

string

static string RIGHT(string $value = '', int $chars = 1)

RIGHT.

Parameters

string $value Value
int $chars Number of characters

Return Value

string

static int STRINGLENGTH(string $value = '')

STRINGLENGTH.

Parameters

string $value Value

Return Value

int

static string LOWERCASE(string $mixedCaseString)

LOWERCASE.

Converts a string value to upper case.

Parameters

string $mixedCaseString

Return Value

string

static string UPPERCASE(string $mixedCaseString)

UPPERCASE.

Converts a string value to upper case.

Parameters

string $mixedCaseString

Return Value

string

static string PROPERCASE(string $mixedCaseString)

PROPERCASE.

Converts a string value to upper case.

Parameters

string $mixedCaseString

Return Value

string

static string REPLACE(string $oldText, int $start, int $chars, string $newText)

REPLACE.

Parameters

string $oldText String to modify
int $start Start character
int $chars Number of characters
string $newText String to replace in defined position

Return Value

string

static string SUBSTITUTE(string $text = '', string $fromText = '', string $toText = '', int $instance = 0)

SUBSTITUTE.

Parameters

string $text Value
string $fromText From Value
string $toText To Value
int $instance Instance Number

Return Value

string

static null|string RETURNSTRING(mixed $testValue = '')

RETURNSTRING.

Parameters

mixed $testValue Value to check

Return Value

null|string

static string TEXTFORMAT(mixed $value, string $format)

TEXTFORMAT.

Parameters

mixed $value Value to check
string $format Format mask to use

Return Value

string

static bool VALUE(mixed $value = '')

VALUE.

Parameters

mixed $value Value to check

Return Value

bool

static float|string NUMBERVALUE(mixed $value = '', string $decimalSeparator = null, string $groupSeparator = null)

NUMBERVALUE.

Parameters

mixed $value Value to check
string $decimalSeparator decimal separator, defaults to locale defined value
string $groupSeparator group/thosands separator, defaults to locale defined value

Return Value

float|string

static bool EXACT($value1, $value2)

Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.

EXACT is case-sensitive but ignores formatting differences. Use EXACT to test text being entered into a document.

Parameters

$value1
$value2

Return Value

bool

static string TEXTJOIN(mixed $delimiter, mixed $ignoreEmpty, mixed ...$args)

TEXTJOIN.

Parameters

mixed $delimiter
mixed $ignoreEmpty
mixed ...$args

Return Value

string