MentDB, The digital brain.  About us Home
Back / All functions / String

Like all languages, you have a few data manipulation functions.

string asciistring binstring bit_lengthstring charstring char_lengthstring char_to_intconcatstring csv_valuestring levenshtein_distancestring md5string countstring encode_b64string decode_b64string del_char_before_each_linestring ends_withstring first_letter_upperstring first_letterstring generate_random_strstring hexstring hex_to_intstring hex_to_strstring indentstring instrstring instrstring int_to_charstring int_to_hexstring int_to_octstring is_letterstring is_alpha_num_udsstring is_alpha_numstring is_number_charstring itrimstring lcasestring leftstring lengthstring likestring locatestring locatestring lowerstring lpadstring lrtrimstring lrtrim0string ltrimstring matchesstring midstring midstring not_likestring not_regexpstring octstring oct_to_intstring positionstring positionstring regexpstring repeatstring repeat_insert_strstring replacestring reversestring rightstring rpadstring rtrimstring spacestring splitstring starts_withstring starts_with_orstring str_to_hexstring strcmpstring strposstring strposstring sublrcharstring substrstring substrstring substringstring substringstring to_stringstring encodestring empty_if_nullstring null_if_emptystring trimstring txtstring txt2string ucasestring unhexstring upperstring zerotype is_matches_regex

string ascii <chr>

Description

    convert a character to integer

Parameters

    chr:   The string - String - required
admin
string ascii "a"
mentdb
97

string bin <num>

Description

    returns a string representation of the binary value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string bin 97
mentdb
1100001

string bit_length <str>

Description

    returns the length of the string str in bits

Parameters

    str:   The string - String - required
admin
string bit_length 61
mentdb
16

string char <num>

Description

    convert an integer to character

Parameters

    num:   The number - Number - required
admin
string char 97
mentdb
a

string char_length <str>

Description

    returns the length of the string. the length is equal to the number of unicode code units in the string.

Parameters

    str:   The string - String - required
admin
string char_length "azerty"
mentdb
6

string char_to_int <chr>

Description

    convert a character to integer

Parameters

    chr:   The string - String - required
admin
string char_to_int "a"
mentdb
97

concat <str1> <strN>

Description

    concat all parameters (do not use this function with string. before)

Parameters

    str1:   The string - String - required
    strN:   The string - String - required
admin
concat 97 "a" "r"
mentdb
97ar

string csv_value <data> <columnSeparator> <quoteChar>

Description

    convert a string into a valid csv value

Parameters

    data:   The string data - String - required
    columnSeparator:   The column separator - String - required
    quoteChar:   Quote char - String - required
admin
string csv_value "a" "," "'"
mentdb
a

string levenshtein_distance <word1> <word2>

Description

    To get the levenshtein distance between two words

Parameters

    word1:   The word 1 - String - required
    word2:   The word 2 - String - required
admin
string levenshtein_distance "admn" "admin"
mentdb
1

string md5 <str>

Description

    get the md5

Parameters

    str:   The string - String - required
admin
string md5 "admin"
mentdb
21232f297a57a5a743894a0e4a801fc3

string count <string> <find>

Description

    count the occurrence number of a string in another string

Parameters

    string:   The string - String - required
    find:   The string - String - required
admin
string count "azertyaze" "a"
mentdb
2

string encode_b64 <string>

Description

    encode a string into b64

Parameters

    string:   The string - String - required
admin
string encode_b64 "azerty"
mentdb
YXplcnR5

string decode_b64 <string>

Description

    decode a string from b64

Parameters

    string:   The string - String - required
admin
string decode_b64 "YXplcnR5"
mentdb
azerty

string del_char_before_each_line <data> <nbChar>

Description

    delete a number of char on each lines

Parameters

    data:   The data - String - required
    nbChar:   The number of chars - Number - required
admin
string del_char_before_each_line "sdlfkjdf
dfgdfgdfgdfgd" 4
mentdb
kjdf
fgdfgdfgd

string ends_with <stringValue> <stringToEnd>

Description

    check if a value ends with another string

Parameters

    stringValue:   The string - String - required
    stringToEnd:   The end string - String - required
admin
string ends_with "azertyaze" 3
mentdb
0

string first_letter_upper <str>

Description

    returns the string in lower case. the first letter in upper case.

Parameters

    str:   The string - String - required
admin
string first_letter_upper "azerty"
mentdb
Azerty

string first_letter <str>

Description

    returns the first letter from a string.

Parameters

    str:   The string - String - required
admin
string first_letter "azerty"
mentdb
a

string generate_random_str <size>

Description

    generate a random string

Parameters

    size:   The size of the string - String - required
admin
string generate_random_str 1
mentdb
D

string hex <num>

Description

    returns a string representation of the hexadecimal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string hex 97
mentdb
61

string hex_to_int <hex>

Description

    convert a hexadecimal number to (bigint) number

Parameters

    hex:   The hex number - String - required
admin
string hex_to_int 97
mentdb
151

string hex_to_str <hex>

Description

    get a string from a hexadecimal representation (ascii).

Parameters

    hex:   The hexadecimal number - String - required
admin
string hex_to_str 61
mentdb
a

string indent <str> <nbSpaceBefore>

Description

    returns the indented string

Parameters

    str:   The string - String - required
    nbSpaceBefore:   The string - String - required
admin
string indent "azerty
a
b
c" 3
mentdb
azerty
a
b
c

string instr <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string instr "azerty" "r"
mentdb
3

string instr <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string instr "azerty" "r" 4
mentdb
-1

string int_to_char <num>

Description

    convert an integer to character

Parameters

    num:   The number - Number - required
admin
string int_to_char 97
mentdb
a

string int_to_hex <num>

Description

    returns a string representation of the hexadecimal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string int_to_hex 97
mentdb
61

string int_to_oct <num>

Description

    returns a string representation of the octal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string int_to_oct 97
mentdb
141

string is_letter <value>

Description

    check if a value contains only letters

Parameters

    value:   The value - String - required
admin
string is_letter "abcd"
mentdb
1

string is_alpha_num_uds <value>

Description

    check if a value contains only letters, underscore char or numbers

Parameters

    value:   The value - String - required
admin
string is_alpha_num_uds "abc_12d"
mentdb
1

string is_alpha_num <value>

Description

    check if a value contains only letters or numbers

Parameters

    value:   The value - String - required
admin
string is_alpha_num "abc12d"
mentdb
1

string is_number_char <value>

Description

    check if a value contains only number char

Parameters

    value:   The value - String - required
admin
string is_number_char "-456.45"
mentdb
0

string itrim <str>

Description

    returns the string with one space character between other chars

Parameters

    str:   The string - String - required
admin
string itrim "aze rty"
mentdb
aze rty

string lcase <str>

Description

    converts all of the characters in this string to lower case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string lcase "AZERTY"
mentdb
azerty

string left <str> <len>

Description

    get the leftmost len characters from the string str.

Parameters

    str:   The string - String - required
    len:   The length - Number - required
admin
string left "AZERTY" 3
mentdb
AZE

string length <str>

Description

    returns the length of this string. the length is equal to the number of unicode code units in the string.

Parameters

    str:   The string - String - required
admin
string length "azerty"
mentdb
6

string like <str> <pat>

Description

    performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string like "azerty" ".*ze.*"
mentdb
1

string locate <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string locate "azerty" "r"
mentdb
3

string locate <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string locate "azerty" "r" 4
mentdb
-1

string lower <str>

Description

    converts all of the characters in this string to lower case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string lower "AZERTY"
mentdb
azerty

string lpad <str> <padString> <paddedLength>

Description

    pads the left-side of a string with a specific set of characters

Parameters

    str:   The string - String - required
    padString:   The pad string - String - required
    paddedLength:   The end of the sub string - Number - required
admin
string lpad "azertyaze" "#" 10
mentdb
#azertyaze

string lrtrim <str>

Description

    returns the string without space character on the left and on the right

Parameters

    str:   The string - String - required
admin
string lrtrim " azerty "
mentdb
azerty

string lrtrim0 <str>

Description

    returns the string without 0 character on the left and on the right

Parameters

    str:   The string - String - required
admin
string lrtrim0 " 123 "
mentdb
123

string ltrim <str>

Description

    returns the string without space character on the left

Parameters

    str:   The string - String - required
admin
string ltrim " azerty "
mentdb
azerty   

string matches <str> <pat>

Description

    performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string matches "azerty" ".*ze.*"
mentdb
1

string mid <str> <index>

Description

    returns a new string that is a substring of this string. the substring begins with the character at the specified index and extends to the end of this string.

Parameters

    str:   The string - String - required
    index:   The begin of the sub string - Number - required
admin
string mid "azertyaze" 3
mentdb
rtyaze

string mid <str> <beginIndex> <endIndex>

Description

    returns a new string that is a substring of this string. the substring begins at the specified beginindex and extends to the character at index endindex - 1. thus the length of the substring is endindex-beginindex

Parameters

    str:   The string - String - required
    beginIndex:   The begin of the sub string - Number - required
    endIndex:   The end of the sub string - Number - required
admin
string mid "azertyaze" 3 5
mentdb
rt

string not_like <str> <pat>

Description

    not performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string not_like "azerty" ".*ze.*"
mentdb
0

string not_regexp <str> <pat>

Description

    not performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string not_regexp "azerty" ".*ze.*"
mentdb
0

string oct <num>

Description

    returns a string representation of the octal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string oct 97
mentdb
141

string oct_to_int <oct>

Description

    convert a octal number to (bigint) number

Parameters

    oct:   The octal number - String - required
admin
string oct_to_int "15"
mentdb
13

string position <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string position "azerty" "r"
mentdb
3

string position <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string position "azerty" "r" 4
mentdb
-1

string regexp <str> <pat>

Description

    performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string regexp "azerty" ".*ze.*"
mentdb
1

string repeat <str> <count>

Description

    returns a string consisting of the string str repeated count times

Parameters

    str:   The string - String - required
    count:   The count number - Number - required
admin
string repeat "AZERTY" 3
mentdb
AZERTYAZERTYAZERTY

string repeat_insert_str <str> <strToInsert> <incr>

Description

    returns a string with a string inserted all n char

Parameters

    str:   The string - String - required
    strToInsert:   The string to insert - String - required
    incr:   The increment - Number - required
admin
string repeat_insert_str "azertyuiop" "-" 3
mentdb
aze-rty-uio-p-

string replace <str> <target> <replacement>

Description

    replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence

Parameters

    str:   The string - String - required
    target:   The string target - String - required
    replacement:   The replacement - String - required
admin
string replace "azerty" "z" 9
mentdb
a9erty

string reverse <str>

Description

    returns the string str with the order of the characters reversed.

Parameters

    str:   The string - String - required
admin
string reverse "AZERTY"
mentdb
YTREZA

string right <str> <len>

Description

    get the rightmost len characters from the string str.

Parameters

    str:   The string - String - required
    len:   The length - Number - required
admin
string right "AZERTY" 3
mentdb
RTY

string rpad <str> <padString> <paddedLength>

Description

    pads the right-side of a string with a specific set of characters

Parameters

    str:   The string - String - required
    padString:   The pad string - String - required
    paddedLength:   The end of the sub string - Number - required
admin
string rpad "azertyaze" "#" 10
mentdb
azertyaze#

string rtrim <str>

Description

    returns the string without space character on the right

Parameters

    str:   The string - String - required
admin
string rtrim " azerty "
mentdb
  azerty

string space <count>

Description

    returns a string consisting of n space characters

Parameters

    count:   The number of space - String - required
admin
string space "5"
mentdb
     

string split <str> <regex> <limit>

Description

    Split a string

Parameters

    str:   The string - String - required
    regex:   The regex - String - required
    limit:   The limit - Number - required
admin
string split "a b c" " " -1
mentdb
["a","b","c"]

string starts_with <stringValue> <stringToStart>

Description

    check if a value starts with another string

Parameters

    stringValue:   The string - String - required
    stringToStart:   The start string - String - required
admin
string starts_with "azertyaze" 3
mentdb
0

string starts_with_or <stringValue> <stringToStart>

Description

    check if a value starts with another string

Parameters

    stringValue:   The string - String - required
    stringToStart:   The start string - String - required
admin
string starts_with_or "azertyaze" aeiou
mentdb
1

string str_to_hex <str>

Description

    get a hexadecimal string representation of str where each character in str is converted to two hexadecimal digits.

Parameters

    str:   The string - String - required
admin
string str_to_hex 97
mentdb
3937

string strcmp <str1> <str2>

Description

    compare two string

Parameters

    str1:   The string 1 - String - required
    str2:   The string 2 - String - required
admin
string strcmp "AZERTY" "iop"
mentdb
-40

string strpos <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string strpos "azerty" "r"
mentdb
3

string strpos <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string strpos "azerty" "r" 4
mentdb
-1

string sublrchar <str> <numberDeleteChar>

Description

    delete a number of char at the start and at the end of the string

Parameters

    str:   The string - String - required
    numberDeleteChar:   The number of char to delete - Number - required
admin
string sublrchar "azerty" 1
mentdb
zert

string substr <str> <index>

Description

    returns a new string that is a substring of this string. the substring begins with the character at the specified index and extends to the end of this string.

Parameters

    str:   The string - String - required
    index:   The begin of the sub string - Number - required
admin
string substr "azertyaze" 3
mentdb
rtyaze

string substr <str> <beginIndex> <endIndex>

Description

    returns a new string that is a substring of this string. the substring begins at the specified beginindex and extends to the character at index endindex - 1. thus the length of the substring is endindex-beginindex

Parameters

    str:   The string - String - required
    beginIndex:   The begin of the sub string - Number - required
    endIndex:   The end of the sub string - Number - required
admin
string substr "azertyaze" 3 5
mentdb
rt

string substring <str> <index>

Description

    returns a new string that is a substring of this string. the substring begins with the character at the specified index and extends to the end of this string.

Parameters

    str:   The string - String - required
    index:   The begin of the sub string - Number - required
admin
string substring "azertyaze" 3
mentdb
rtyaze

string substring <str> <beginIndex> <endIndex>

Description

    returns a new string that is a substring of this string. the substring begins at the specified beginindex and extends to the character at index endindex - 1. thus the length of the substring is endindex-beginindex

Parameters

    str:   The string - String - required
    beginIndex:   The begin of the sub string - Number - required
    endIndex:   The end of the sub string - Number - required
admin
string substring "azertyaze" 3 5
mentdb
rt

string to_string <str>

Description

    return a valid sql string data (example: 'i'am a man')

Parameters

    str:   The string - String - required
admin
string to_string "az\"erty"
mentdb
'az"erty'

string encode <str> <sourceEnc> <destinationEnc>

Description

    encode a string to another encoding format

Parameters

    str:   The string - String - required
    sourceEnc:   The source encoding format - String - required
    destinationEnc:   The destination encoding format - String - required
admin
string encode "az\"erty" "ISO-8859-1" "UTF-8"
mentdb
az"erty

string empty_if_null <str>

Description

    set the string to empty if the string is null

Parameters

    str:   The string - String - required
admin
string empty_if_null "a b@mail.com"
mentdb
a b@mail.com

string null_if_empty <str>

Description

    set the string to null if the string is empty

Parameters

    str:   The string - String - required
admin
string null_if_empty "a b@mail.com"
mentdb
a b@mail.com

string trim <str>

Description

    returns the string without space character on the right, left and with one space inside

Parameters

    str:   The string - String - required
admin
string trim " aze rty "
mentdb
aze rty

string txt <data>

Description

    return a valid sql string data (example: 'i'am a man')

Parameters

    data:   The data - String - required
admin
string txt "az'erty"
mentdb
'az\'erty'

string txt2 <data>

Description

    return a valid sql string data (example: 'i''am a man')

Parameters

    data:   The data - String - required
admin
string txt2 "az'erty"
mentdb
'az''erty'

string ucase <str>

Description

    converts of all the characters in this string to upper case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string ucase "azerty"
mentdb
AZERTY

string unhex <hex>

Description

    convert a hexadecimal number to (bigint) number

Parameters

    hex:   The hex number - String - required
admin
string unhex 97
mentdb
151

string upper <str>

Description

    converts of all the characters in this string to upper case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string upper "azerty"
mentdb
AZERTY

string zero <str>

Description

    return a 0 if empty string else return the string

Parameters

    str:   The string - String - required
admin
string zero "az'erty"
mentdb
az'erty

type is_matches_regex <str> <pat>

Description

    performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
type is_matches_regex "azerty" ".*ze.*"
mentdb
1




© 2012 - 2018 - Innov-AI.