The following is a list of the String functions. Click the links for further information.
This function evaluates the ASCII value of the first character of the argument.
Parameter
a - A Char value.
Return value
The return value is an Integer.
Example
The return value of the following statement is 97.
Asc("abc")
This function will return the size of a message in the "appropriate" unit.
Parameter
Byte is the size of a message in bytes.
Return value
String.
Examples
ByteToText(1000)
- Returns 1000 bytes.ByteToText(251561)
- Returns 245 KB.ByteToText(10000000)
- Returns 9 MB.ByteToText(25454464)
- Returns 24 MB.This function returns a single character string associated with the ASCII value passed as the argument.
Parameter
a - A BigInt value.
Return value
The return value is a String.
Examples
Chr(99)
Chr(123)
This function will begin by determining whether the address is in X500 or X400 format. Once this has been ascertained, the function will then determine the ID.
Note: The fields must follow the address type standards for the functions to operate them.
Parameter
address - The address of sender/recipient (String data type).
Return value
String value.
Examples
ExchGetID("/o=Jinfonet Software/ou=JREPORT /cn=Configuration/cn=Servers/cn=ESPRESSO/cn=Fredt")
- Returns "Fredt".ExchGetID("c=US ;a= ;p=Jinfonet; o=apps-wga; dda:smtp=Jenny@jinfonet.com")
- Returns "Jenny@jinfonet.com".ExchGetID("c=US; a= ;p=Jinfonet;o=apps-wga;dda:ms=com/jreport/Jenny")
- Returns "com/jreport/Jenny".This function will begin by determining whether the address is in X500 or X400 format. Once this has been ascertained, the function will then determine the Organization Name.
Note: The fields must follow the address type standards for the functions to operate on them.
Parameter
address - The address of the sender/recipient (String data type).
Return value
String value.
Examples
ExchGetOrganization("c=US ;a= ;p=Jinfonet; o=apps-wga; dda:ms=com/jreport/Jenny")
- Returns "Jinfonet".ExchGetOrganization("c=US ;a= ;p=Jinfonet; o=apps-wga; dda:smtp=Jenny@jinfonet.com")
- Returns "Jinfonet".This function will return the container information in an address field.
Parameter
path - The address of sender/receiver (String data type).
Examples
ExchGetPath("/o=Jinfonet Software/ou=JREPORT /cn=Configuration/cn=Servers/cn=ESPRESSO/cn=Fredt")
- Returns "cn=Configuration/cn=Servers/cn=ESPRESSO".ExchGetPath("c=US; a= ; p=Jinfonet; ou1=Jenny; ou2=JReport; o=apps-wga;")
- Returns "ou1=Jenny; ou2=JReport".ExchGetpath("DDA:MS=JREPORT/JENNY/jreport")
- Returns "MS=JREPORT/JENNY/jreport".The function will begin by determining whether the address is in X500 or X400 format. Once this has been ascertained, the function will then determine the Site Name.
Note: The fields must follow the address type standards for the functions to operate on them.
Parameter
address - The address of sender/recipient (String data type).
Return value
String value.
Examples
ExchGetSite("/o=Jinfonet Software/ou=JReport/cn=Configuration/cn=Servers/cn=ESPRESSO/cn=Fredt")
- Returns "JReport".ExchGetSite("c=US; a= ;p=Jinfonet;o=apps-wga; dda:smtp=Jenny@jinfonet.com")
- Returns "apps-wga".This function is used to evaluate an origin string and returns the first occurrence of a String that starts with the Start String and ends with the End String (the End String is excluded). If the End String is not found, the string that starts with the Start String till its end will be returned.
Parameters
Return value
The return value is a String.
Examples
ExtractString("one day after that day", "d", " ")
ExtractString("one day after that day", "d", "c")
This function is designed to search the string in the specified strings. It searches an array of strings for a specified string, and returns the strings in an array.
Overloads
Parameters
Return value
Array of String values.
Examples
Suppose that inString = [ "abc", "Abc", "abcdfg", "asdfabc", "sdfdfd"], searchString = "abc"
filter(inStrings, searchString)
- Returns ["abc", "abcdfg", "asdfabc"].filter(inStrings, searchString, true)
- Returns ["abc", "abcdfg", "asdfabc"].filter(inStrings, searchString, false)
- Returns ["abc"].filter(inStrings, searchString, true, 0)
- Returns ["abc", "abcdfg", "asdfabc"]filter(inStrings, searchString, true, 1)
- Returns ["abc", "Abc", "abcdfg", "asdfabc"].filter(inStrings, searchString, false, 1)
- Returns ["abc", "Abc"].string inString[]=["John","Paul","George","Ringo"];
join(filter(inString,"o"),",");
This formula can search strings which include the word "o" and use comma to compart them.
This function returns the position of the first occurrence of one string within another. If String a is not found in String b, the InStr function will return -1.
Parameters
Return value
The return value is an Integer.
Examples
InStr("my", "he is my brother")
InStr("our", "she is my mother")
String value = toText(@Price, "####.##", 2, "", ".");
integer dot = InStr(".", value);
if (dot >= 0)
{
return ToWords(ToNumber(left(value, dot)), 0) + " dollars "
+ToWords(ToNumber(mid(value, dot + 1)), 0) + " cents";
}
else
{
return ToWords(ToNumber(value), 0) + " dollars";
}
This formula can convert number format to dollars and cents pattern.
This function returns the position of the first occurrence of one string within another, starting at the position specified by argument a. If String c is not found in String b, the InStr function will return -1.
Parameters
Return value
The return value is an Integer.
Examples
InStr(3, "he is my brother", "my")
InStr(3, "he is my brother", "our")
Returns a string created by joining a number of substrings contained in an array.
Overloads
Parameters
Return value
String value.
Examples
Assume that the stringArray list in the examples consists of the following three elements: Welcome, Use and JReport.
join(list)
- Returns the string WelcomeUseJReport.join(list, "***")
- Returns the string Welcome***Use***JReport.This function returns the position of the last occurrence of one string within another, if String b is not found in String a, the InStr function will return -1.
Parameters
Return value
The return value is an Integer.
Examples
LastIndexOf("avcievmgbvi","v")
LastIndexOf("avcievmgbvi","n")
This function returns the position within this string of the first occurrence of the specified substring, searching backward starting at the position specified by argument a. If String c is not found in String b, the InStr function will return -1.
Parameters
Return value
The return value is an Integer.
This function returns a substring that contains the specified number of characters from the left side of a string.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is he is.
Left("he is my father", 5)
This function returns the number of characters in a String.
Parameter
a - A String value.
Return value
The return value is an Integer.
Example
The return value of the following statement is 16.
Length("she is my mother")
This function enables you to locate field values using standard DOS wildcards ( ? is a wildcard for a single character, * is a wildcard for any number of characters). It does this by comparing a String to a mask which contains one or more wildcards. The function returns True if the string matches the mask, and False if the string does not match the mask.
Parameters
Return value
The return value is True or False.
Examples
LooksLike("he is my brother", "he is my brother and friend")
LooksLike("he is my brother", "he is my brother")
LooksLike("George Peck", "G?orge*")
- Returns True.This function returns a String that contains all lowercase letters converted from String a.
Parameter
a - A String value.
Return value
The return value is a String.
Example
The return value of the following statement is this is her book.
LowerCase("This is HER book")
This function returns a number of characters from a specified position of a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is my father.
Mid("he is my father", 6)
This function returns a specified number of characters from a specified position of a String.
Parameters
Return value
The return value is a String.
Examples
Mid("he is my father", 9, 6)
- Returns "father".Integer ln,i;
String str1;
str1="";
ln=length(@col);
for (i=1;i<ln ; i=i+1)
str1=str1 + mid(@col, i, 1) + "\n";
return str1;
This formula can convert a DBField string from a normal horizontal pattern to a vertical pattern.
This function is used to test if the content of the string is a Number.
Parameter
a - A String value to be tested.
Return value
The return value is Boolean.
Examples
NumericText("she is my mother")
NumericText("123456")
This function prints a string or values in a string in a predetermined format.
Parameters
Return value
The return value is a string.
Examples
Picture("Brother", "XxXXxxx Tom")
Picture("He Tom", "xx is")
Picture("8007733472", "Phone: (xxx) xxx-xxxx")
- Returns Phone: (800) 773-3472. Capitalizes the first letter in a text string and any other letter that follows a character other than a letter, and converts all other letters to lowercase letters.
Overloads
ProperCase(String)
Parameter
String - A text string.
Return value
String value.
Examples
Returns a String in which a specified substring has been replaced with another substring a specified number of times. As an option, you can also specify a location in the string where the replacing process will begin from (returns a string starting from that position). This function is typically used in a string to systematically replace one substring with another.
Overloads
Parameters
Return value
String value.
Examples
Assume that inStrings = "abc Abc abcdfg asdfabc sdfdfd", searchString = "abc", replaceString = "ABC".
ReplaceString(inStrings, searchString, replaceString)
- Returns "ABC Abc ABCdfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 5)
- Returns "abc Abc ABC dfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0)
- Returns "ABC Abc ABCdfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, 0)
- Returns "abc Abc abcdfg asdfabc sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, 1)
- Returns "ABC Abc abcdfg asdfabc sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, -1,1)
- Returns "ABC ABC ABCdfg asdfABC sdfdfd".ReplaceString(inStrings, searchString, replaceString, 0, -1, 0)
- Returns "ABC Abc ABCdfg asdfABC sdfdfd".Note: The return value of the replace function is a String, with the specified substring replacements made, beginning at the position specified by startPosition, and endings at the end of the inString string. It is not a start to finish copy of the original string.
This function replicates the string in String a the number of times specified by b.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is Stop! Stop! Stop!.
ReplicateString("Stop!", 3)
This function is used to extract the specified number of characters in String a from the right side.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is mother.
Right("She is my mother", 6)
Evaluates a text string and returns a four-character value that symbolizes the way the string sounds. Use this function whenever you want to locate records based on two or more field values that are spelled differently yet sound alike. This function can also be used to find customer names that have been misspelled.
Parameter
String is one of two or more strings that sound alike.
Return value
Text string.
Examples
Soundex("Jinfonet")
- Returns J515. if (Soundex("George") == Soundex("gorge")) then
"Sound the same"
else
"Different sound"
- Returns Sound the same.
Notes:
This function returns a String value that contains a specified number of spaces.
Parameter
a - A BigInt value indicating the number of spaces.
Return value
The return value is a String.
Example
The return value of the following statement is .
Space(3)
This function is used to compare two strings. It returns positive if String a is greater than String b, returns 0 if String a is equal to String b, and returns negative if String a is less than String b.
Parameters
Return value
The return value is an Integer.
Examples
StrCmp("He is Tom", "I am student")
StrCmp("He is Tom", "He is Tom")
StrCmp("I am student", "He is Tom")
This function takes a String that contains a number of substrings, breaks it up into a specified number of substrings and returns an array containing the substrings.
Overloads
Parameters
Return value
Array of String values.
Examples
Assume that inString = "Welcome use JReport"
StringSplit(inString)
- Returns [ "Welcome", "use", "JReport"]StringSplit(inString, "use")
- Returns [ "Welcome", "JReport"]StringSplit(inString, " ", 2)
- Returns [ "Welcome", "use JReport"]Note: If count, c, is less than the total number of substrings in inString, then at most c substrings will be returned as elements in the resultant array. The last element in the array is a concatenation of the substring and all the remaining substrings.
This function is designed to reverse the string. It returns a String in which the character order of inString is reversed. If inString is a zero-length string (" "), a zero-length string will be returned.
Parameter
inString - A String whose characters are to be reversed.
Return value
String value.
Examples
strReverse("abc")
- Returns cba.strReverse("false")
- Returns eslaf.This function converts a string to a long string.
Parameter
a - A String value.
Return value
The return value is a LongString.
Example
The return value of the following statement is aa.
LongString a=toLongString("aa");
string b="bb";
if (b > toString(a)) then
return a
else
return toLongString(b);
This function converts a Currency to a Number.
Parameter
a - A Currency value.
Return value
The return value is a Number.
Examples
ToNumber($4.32)
ToNumber($4.68)
This function converts a specified string to a Number.
Parameter
a - A Char value.
Return value
The return value is a Number.
Example
The return value of the following statement is 123.00.
ToNumber("123")
Note: In this function, the format of the string should be [#] or [#].[#]. If you input a character string as the argument, the return value will be NULL.
This function converts a long string to a string.
Parameter
a - A LongString value.
Return value
The return value is a String.
Examples
The return value of the following statement is aa.
LongString a=toLongString("aa");
string b="bb";
if (b > toString(a)) then
return a
else
return toLongString(b);
This function converts a Bit value to a String, either true or false.
Parameter
a - A Bit value.
Return value
The return value is a String.
Example
The return value of the following statement is false.
ToText(3<2)
This function converts a Currency value to a String.
Parameter
a - A Currency value to be converted.
Return value
The return value is a String.
Example
The return value of the following statement is $123.45.
ToText($123.45)
This function converts a Currency value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is $123.45.
ToText($123.45, "$##0.00")
This function converts a Currency value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is $123.5.
ToText($123.456, "$##0.00", 1)
This function converts a Currency value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is $1*234.57.
ToText($1234.57, "$#,###.000", 2, "*")
This function converts a Currency value to a String.
Parameters
Return value
The return value is a String.
Examples
ToText($4567.123, "$#,##0.00", 3, "," , ".")
ToText($4567.123, "$#,##0.00", 1, "&", "*")
This function converts a Currency value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is $123.46.
ToText($123.4567, 2)
This function converts a Currency value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is $1,234.57.
ToText($1234.567, 2, ",")
This function converts a Currency value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is $1,234.57.
ToText($1234.567, 2, ",", ".")
This function converts a Date value to a String.
Parameter
a - A Data value.
Return value
The return value is a String.
Example
Suppose the date is July 15,1999, the return value of the following statement is 15-Jul-99.
ToText(ToDate(1999,7,15))
This function converts a Date value to a String.
Parameters
Return value
The return value is a String.
Example
Suppose the date is July 15,1999, the return value of the following statement is 15-Jul-99.
ToText(ToDate(1999,7,15), "dd-MMM-yy")
This function converts a DateTime value to a String.
Parameter
a - A TimeStamp value to be converted.
Return value
The return value is a String.
Example
Suppose the date is July 15,1999 and time is 7:42:51, the return value of the following statement is 15-Jul-99 7:42:51 AM.
ToText(ToDateTime(1999,7,15,7,42,51))
This function converts a DateTime value to a String.
Parameters
Return value
The return value is a String.
Example
Suppose the date is July 15,1999 and time is 7:42:51, the return value of the following statement is 07-15-99 7:42:51.
ToText(ToDateTime(1999,7,15,7,42,51), "MM-dd-yy h:mm:ss")
This function converts a DateTime value to a String.
Parameters
Return value
The return value is a String.
Example
Suppose the date is July 15,1999 and time is 7:42:51, the return value of the following statement is 15-Jul-99 7:42:51 AM.
ToText(ToDateTime(1999,7,15,7,42,51), "dd-MMM-yy h:mm:ss a", "AM")
This function converts a DateTime value to a String.
Parameters
Return value
The return value is a String.
Examples
ToText(ToDateTime(1999,10,7,7,42,51), "dd-MMM-yy h:mm:ss a", "AM", "PM")
ToText(ToDateTime(1999,10,7,18,42,51), "dd-MMM-yy h:mm:ss a","AM", "PM")
This function converts a BigInt value to a String.
Parameter
a - A BigInt value to be converted.
Return value
The return value is a String.
Example
The return value of the following statement is 456.
ToText(456)
This function converts a BigInt value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 456.
ToText(456, "###")
This function converts a BigInt value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 456.00.
ToText(456, "###", 2)
This function converts a BigInt value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1,234.00.
ToText(1234, "#,###", 2, ",", ".")
This function converts a BigInt value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1,234.00.
ToText(1234, "#,###", 2, ",", ".")
This function converts a BigInt value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 123.00.
ToText(123, 2)
This function converts a BigInt value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1,234.00.
ToText(1234, 2, ",")
This function converts a BigInt value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 12,345.00.
ToText(12345, 2, ",", ".")
This function converts a Double value to a String.
Parameter
a - A Double value to be converted.
Return value
The return value is a String.
Example
The return value of the following statement is 123.456.
ToText(123.456)
This function converts a Double value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1236.46.
ToText(1236.456, "###0.00")
This function converts a Double value to a String.
Parameters
Return value
The return value is a string.
Example
The return value of the following statement is 123.46.
ToText(123.456, "###.00", 2)
This function converts a Double value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1,234.57.
ToText(1234.567, "#,###.000", 2, ",")
This function converts a Double value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1,234.57.
ToText(1234.567, "#,###.000", 2, ",", ".")
This function converts a Double value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 123.46.
ToText(123.456, 2)
This function converts a Double value to a string.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1,234.6.
ToText(1234.567, 1, ",")
This function converts a Double value to a String.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is 1,234,57.
ToText(1234.567, 2, "," , ",")
This function converts a Time value to a String.
Parameter
a - A Time value.
Return value
The return value is a String.
Example
Suppose the time is 12:40:30, the return value of the following statement is 12:40:30 PM.
ToText(ToTime(12,40,30))
This function converts a Time value to a String.
Parameters
Return value
The return value is a String.
Example
Suppose the time is 08:48:58, the return value of the following statement is 8:48:58.
ToText(ToTime(8,48,58), "h:mm:ss")
This function converts a Time value to a String.
Parameters
Return value
The return value is a String.
Example
Suppose the time is 8:48:58 in the morning, the return value of the following statement is 8:48:58 AM.
ToText(ToTime(8,48,58), "h:mm:ss a", "AM")
This function converts a Time value to a String.
Parameters
Return value
The return value is a String.
Examples
ToText(ToTime(8,48,58), "h:mm:ss a", "AM", "PM")
ToText(ToTime(21,49,59), "h:mm:ss a", "AM", "PM")
Notes:
Symbol | Meaning | Notes |
---|---|---|
0 | a digit | |
* | a digit, zero shows as a star | Can't mix 0, *, and _ in same format |
_ | a digit, zero shows as a space | Can't mix 0, *, and _ in same format |
# | a digit, zero shows as absent | |
. | placeholder for decimal separator | |
, | placeholder for grouping delimiter | Shows the interval to be used |
; | separates formats | positive and negative. |
- | if there is no explicit negative sign, - is prefixed | "0.00" -> "0.00;-0.00" |
% | divide by 100 and show as percentage | |
X | any other characters can be used in the prefix or suffix |
Symbol | Meaning | Presentation | Example |
---|---|---|---|
G | era designator | Text | AD |
y | year | Number | 1996 |
M | month in year | Text & Number | July & 07 |
d | day in month | Number | 10 |
h | hour in am/pm (1~12) | Number | 12 |
H | hour in day (0~23) | Number | 0 |
m | minute in hour | Number | 30 |
s | second in minute | Number | 55 |
S | millisecond | Number | 978 |
E | day in week | Text | Tuesday |
D | day in year | Number | 189 |
F | day of week in month | Number | 2 (2nd Wed in July) |
w | week in year | Number | 27 |
W | week in month | Number | 2 |
a | am/pm marker | Text | PM |
k | hour in day (1~24) | Number | 24 |
K | hour in am/pm (0~11) | Number | 0 |
z | time zone | Text | Pacific Standard Time |
' | escape for text | ||
'' | single quote |
This function converts a Number field value or the result of a numeric calculation to words.
Parameter
a - A Currency value to be converted into words.
Return value
The return value is a String.
Example
The return value of the following statement is three and 15/100.
ToWords($3.15)
This function converts a Number field value or the result of a numeric calculation to words.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is three and 5/10.
ToWords($3.45, 1)
This function converts a Number field value or the result of a numeric calculation to words.
Parameter
a - A BigInt value to be converted into words.
Return value
The return value is a String.
Example
The return value of the following statement is twenty and xx/100.
ToWords(20)
This function converts a Number field value or the result of a numeric calculation to words.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is three and x/10.
ToWords(3, 1)
This function converts a Number field value or the result of a numeric calculation to words.
Parameter
a - A fractional number to be converted into words.
Return value
The return value is a String.
Example
The return value of the following statement is ten and 12/100.
ToWords(10.12)
This function converts a Number field value or the result of a numeric calculation to words.
Parameters
Return value
The return value is a String.
Example
The return value of the following statement is three and 1/10.
ToWords(3.14, 1)
This function is used to remove the leading and the trailing spaces from string arguments.
Parameter
a - A String value.
Return value
The return value is a String.
Example
The return value of the following statement is he is a boy.
Trim("he is a boy")
This function is used to remove the spaces on the left side of the string.
Parameter
a - A String value to be trimmed.
Return value
The return value is a String.
Example
The return value of the following statement is he is a boy.
TrimLeft("he is a boy")
This function is used to remove the spaces on the right side of the string.
Parameter
a - A String value to be trimmed.
Return value
The return value is a String.
Example
The return value of the following statement is he is a boy.
TrimRight("he is a boy")
This function converts all letters in string a to uppercase letters.
Parameter
a - A String value.
Return value
The return value is a String.
Example
The return value of the following statement is HE IS A BOY.
UpperCase("he is a boy")
This function reads a string containing numbers (e.g. address, phone or social security number), and converts them to a decimal value. Val stops reading when it finds the first character in the string.
Parameter
a - A String value.
Return value
The return value is a Number.
Example
The return value of the following statement is 63,550,513.00.
Val("63550513Mr.Tom")