String Functions


  • STRLEN Retrieve the length of a string.
  • LOWER Converts all uppercase letters in a string string to lowercase.
  • UPPER Converts string to uppercase.
  • UCFIRST Makes a string's first character uppercase.
  • UCWORDS Converts the first character of each word in a string to uppercase.
  • STRINSERT Inserts a sub-string at the given position within string.
  • REPLACE Replaces all occurrences of the search string with the replacement string.
  • TRIMLEFT Removes whitespace from the beginning of a string.
  • TRIMRIGHT Removes whitespace from the end of a string.
  • TRIME Removes spaces from the beginning and end of a string.
  • LEFT Returns the specified number of characters from the begging of a string.
  • RIGHT Returns the rightmost characters from a string value.
  • MID Returns a specific number of characters from a string string starting at the position you specify.
  • CODE Returns the code number of character.
  • CHAR Returns the character specified by the code number.
  • STRSTR Finds the first occurrence of a string.
  • STRSTRI Finds the first occurrence of a case-insensitive string.
  • STRPOS Finds the position of the first occurrence of a substring in a string.
  • STRPOSI Finds the position of the first occurrence of a case-insensitive substring in a string.
  • RSTRPOS Finds the position of the last occurrence of a substring in a string.
  • RSTRPOSI Finds the position of the last occurrence of a case-insensitive substring in a string.
  • STRRETP Repeats string a given number of times.
  • FORMAT_MONEY Formats a number as a currency string for a locale specified.
  • FORMAT_DATE Returns the formatted date string.
  • BASE64_ENCODE Encodes a string with MIME base64.
  • BASE64_DECODE Decodes a string with MIME base64.
  • STRCLEAN Removes all nonprintable characters from string.
  • MD5 Calculates the md5 hash of a string.

STRLEN

Retrieve the length of a string.

string STRLEN( string )

LOWER

Converts all uppercase letters in a string string to lowercase.

string LOWER( string )

UPPER

Converts string to uppercase.

string UPPER( string )

UCFIRST

Makes a string's first character uppercase.

string UCFIRST( string )

UCWORDS

Converts the first character of each word in a string to uppercase.

string UCWORDS( string )

STRINSERT

Inserts a sub-string at the given position within string..

string STRINSERT( string, pos, string_to_insert )

Examples:

STRINSERT( "This is a sample", 4, "BBB" ) //return string "ThisBBB is a sample"

STRINSERT( "This is a sample", 4000, "BBB" ) //return string "This is a sampleBBB"

STRINSERT( "This is a sample", -20, "BBB" ) //return string "BBBThis is a sample"

REPLACE

Replaces all occurrences of the search string with the replacement string.

string REPLACE( string, find_string, new_string )

Note: This function can be used to remove all occurrences of the search string. The comparison is case-sensitive.

Examples:

REPLACE( "This is a sample", "is", "" ) //return string "Th a sample"

TRIMLEFT

Removes whitespace from the beginning of a string.

string TRIMLEFT( string )

TRIMRIGHT

Removes whitespace from the end of a string.

string TRIMRIGHT( string )

TRIM

Removes spaces from the beginning and end of a string.

string TRIM( string )

LEFT

Returns the specified number of characters from the begging of a string.

string LEFT( string, num_characters )

RIGHT

Returns the rightmost characters from a string value.

string RIGHT( string, num_characters )

MID

Returns a specific number of characters from a string string starting at the position you specify.

string MID( string, pos, [num_characters] )

Note: The parameter num_characters is optional, omiting it does mean get all characters from the position pos to the end of the string.

Examples:

MID( "This is a sample", 1, 3 ) //return the string "his"

MID( "This is a sample", 3 ) //return the string "s is a sample"

CODE

Returns the code number of character.

Number CODE( string ,[pos] )

Note: The parameter pos is optional, its default value is 0.

Examples:

CODE( "ABC" ) //return number 65

CODE( "ABC", 1 ) //return number 66

CHAR

Returns the character specified by the code number.

string CHAR( number )

Examples:

CHAR( 65 ) //return number "A"

STRSTR

Finds the first occurrence of a string.

string STRSTR( string, find_string )

Note: The comparison is case-sensitive. This function returns a empty string if failed.

Examples:

STRSTR( "This is a sample", "is" ) //return string "is is a sample"

STRSTR( "This is a sample", "IS" ) //return empty string

STRSTRI

Finds the first occurrence of a case-insensitive string.

string STRSTRI( string )

STRPOS

Finds the position of the nth occurrence of a substring in a string.

Number STRPOS( string, find_string, [num_sequence] )

Note: This function returns -1 if failed. The comparison is case-sensitive.

STRPOSI

Finds the position of the nth occurrence of a case-insensitive substring in a string.

Number RSTRPOS( string, find_string, [num_sequence] )

RSTRPOS

Reverses find the index position of the nth occurrence of a substring in a string.

Number RSTRPOS( string, find_string, [num_sequence] )

Note: This function returns -1 if failed. The comparison is case-sensitive.

RSTRPOSI

Reverses find the position of the nth occurrence of a case-insensitive substring in a string.

Number RSTRPOSI( string, find_string, [num_sequence] )

STRREPT

Repeats string a given number of times.

string STRREPT( string, num_times )

FORMAT_MONEY

Formats a number as a currency string for a locale specified.

string FORMAT_MONEY( number )

Note: The function will use the current local settings of Windows to convert the number.

FORMAT_DATE

Returns the formatted date string.

string FORMAT_DATE( datetime, [format_string] )

Note: About the format string, you please refer to the action Format Date and Time.

Examples:

FORMAT_DATE( now, "yyyy-MM-dd" ) //return string "2013-10-1"

BASE64_ENCODE

Encodes a string with MIME base64.

string BASE64_ENCODE( string )

BASE64_DECODE

Decodes a string with MIME base64.

string BASE64_DECODE( string )

Note: The parameter string should be a valid based64 encoded string.

STRCLEAN

Removes all nonprintable characters from string.

string STRCLEAN( string )

Note: Any character that is not a displayable ASCII character is removed from the string, included CRLF.

MD5

Calculates the md5 hash of a string.

string MD5( string )