String Functions

left()

left() tiene dos parámetros, una cadena y un número n, y devuelve los primeros n caracteres de la cadena. Por ejemplo:

 

left("race result";4) - returns race

 

left([LastName];1) - returns the first character of the last name

right()

right has two paramters, a string and a number n, and returns the last n characters of the string. For example:
right("race result";4) - returns sult
right([LastName];1) - returns the last character of the last name

mid()

mid has three parameters, a text and two numbers m and n. It returns n characters of the string, beginning at the m-th character. For example:
mid("race result"; 6; 3) - returns res

instr()

instr returns the position of the first occurence of a substring in a string. The first parameters determines where to start searching.
instr(1;"race result";" ") - returns 5
instr(2;"ab";"a") - returns 0, since there is no a if searching from the second character on.

instr2()

instr2 is similar to instr(), but considers áàä etc. as a, éèê etc. as e, and so on
instr2(1;"ráce result";"a") - returns 2

SplitString()

SplitString takes 3 parameters - a string, a delimeter and a number n.

The string is split at each occurence of the delimeter, then the nth object is returned, for example:

SplitString("a,b,c,d"; ","; 3) returns c

val()

val converts a string into a number. For example, this function can be used to sort numerically by the values in an additional text field.
val([ATF1]) - can be used for numerical sorting by ATF1
val("3")<val("20") - returns 1 (true)
"3"<"20" - returns 0 (false due to text comparison)

len()

len returns the length of a text.
len("race result") - returns 11.
len([LastName]) - returns the length of the last name

lcase()

The function LCase converts all characters to lower case.
UCase([LastName]) & ", " & LCase([FirstName]) - returns for example DOE, john

ucase()

The function UCase converts all characters to upper case.
UCase([LastName]) & ", " & LCase([FirstName]) - returns for example DOE, john

trim()

trim removes white spaces at the beginning and end of a text and returns the remaining string:
trim(" Hello World   ") - returns "Hello World"

string()

string has two parameters, a number n and a text. It repeats the text n times.
string(3; "Run! ") - return "Run! Run! Run! ".

replace()

replace replaces parts of a text by another text.
replace("race result"; " "; "-") - returns "race-result".

reduceChars()

reduceChars has two strings a and b as parameters and returns only those characters of a that are part of b:

 

reduceChars("race result 12 software 2020"; "0123456789") - returns 122020

 

removeAccents()

removeAccents removes accents from any letter:
removeAccents("Café au Lait") - returns "Cafe au Lait"

chr()

Chr has one parameter and converts an ASCII code to the corresponding character.
chr(65) - returns "A"

asc()

Asc has one parameter and returns the ASCII code of the first character of the parameter.
 asc("A") - returns 65.

ordinal()

ordinal returns English ordinal numbers:
ordinal(1) - returns "1st"
ordinal(3) - returns "3rd"
ordinal(15) - returns "15th"

similarity()

The function similarity returns the similarity of two strings as value between 0 and 1.
similarity("Hansaplast";"HansPlasta") - returns 0.625
similarity([LastName];[LastName]) - returns 1

CorrectSpelling()

La función CorrectSpelling convierte los caracteres del nombre/apellido en mayúsculas y minúsculas como se espera: el primer carácter estará en mayúsculas, todos los demás caracteres en minúsculas. Las palabras "de", "der", "und", "van", "von" y "zu" estarán siempre en minúsculas.

CorrectSpelling("max VON uNd zu mustERMann") - devuelve Max von und zu Mustermann

stringCount()

stringCount takes two strings a and b. It returns how often b appears in a

 

stringCount("race result 12"; "r") - returns 2