functions:functions_list
This is an old revision of the document!
Table of Contents
FUNCTIONS
Functions lets you manipulate strings and/or numbers to fit your needs.
Usage description:
$function(input-1 = "string", input-2 = integer[, optional input-3 = "string"/integer])
- ALL string inputs containing alphabetic characters (a-z, A-Z) must be encapsulated with single or double quotes: “my string”, '123abc', “%s_variable%”, '%i_variable%'.
- Functions that accept numbers do not need to be encapsulated with quotes.
- If numeric character(s) (0-9) are used in functions that accept strings then the number will be treated as a string: 123 = “123”
- All functions can be nested (functions within functions):$replace($left(“my strings”, 6), “my”, “your”) = “your str”
- Nested function must NOT be encapsulated with quotes.See Nested Functions
Character String Functions
| $left | Get string n-characters from the left side. |
| $triml | Trim string n-characters from the left side. |
| $right | Get string n-characters from the right side. |
| $trimr | Trim string n-characters from the right side. |
| $middle | Get string n-characters from n-position. |
| $between | Get string between two strings. |
| $upper | Force string to upper case. |
| $lower | Force string to lower case. |
| $proper | Capitalizes every first letter following a non-alphanumeric character. |
| $replace | Replace string in string. |
| $alrep | Replace all non-alphanumeric characters and add optional exceptions. |
| $leads | Add leading character(s) to a string. If string to fill is omitted a zero (0) will be used. |
| $trails | Add trailing character(s) to a string. If fill-string is omitted a zero (0) will be used. |
| $stripws | Removes leading and trailing white spaces. |
| $stripcrlf | Strips string for line feed and carriage returns. |
| $isdigit | Check if string is only numbers. Success returns 1, failure returns 0. |
| $isalpha | Check if string is only alphabetic letters. Success returns 1, failure returns 0. |
| $length | Retrieves length of the string (number of characters). |
| $reverse | Reverse a string. |
Mathematics Functions
| $round | Round number to nearest decimal. |
| $roundd | Round number down to nearest integer. |
| $roundu | Round number up to nearest integer. |
| $inttotc | Convert integer to time code. |
| $tctosec | Convert time code to seconds. |
| $abs | Returns the absolute value of a number. |
| $log | Returns the natural logarithm of a number. |
| $random | Returns a random integer number between two integers. |
Other Functions
| $exists | This is a file function that will tell if file(s) exists. |
| $base64 | Encodes the input string as base 64. |
| $jsonencode | Converts the input string to an JSON friendly string. |
| $jsonget | Retrieves the value from a JSON object key. Here is an example to retrieve values from ffprobe |
| $readarray | Returns an instance from a valid array; “[data, data, etc…]”. |
| $regext | This is regular expression function. It extracts text based on recognition patterns. |
| $hex | Converts a decimal integer to hexadecimal number. |
| $dec | Converts a hexadecimal number to decimal integer. |
| $guid | Returns a random GUID/UUID. |
| $xxhash | Returns an eight character hash for any file. |
| $read | Reads the contents of a any text file. |
| $urlencode | Converts the input string to an URL friendly string. |
functions/functions_list.1605553720.txt.gz · Last modified: 2020/11/16 19:08 by 127.0.0.1