{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}Object{td}{td}[#dateFormat]\(date, format)
Format a date object to a text representation or a parses a datestring to a date object.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getUnicodeCharacter]\(unicodeCharacterNumber)
Returns a string containing the character for the unicode number.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#hasRecords]\(foundset_or_record, qualifiedRelationString)
Returns true if the (related)foundset exists and has records.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isMondayFirstDayOfWeek]\()
Returns true when Monday is the first day of the week for your current locale setting.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#numberFormat]\(number, digitsOrFormat)
Format a number to specification (or to have a defined fraction).{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringEscapeMarkup]\(textString, escapeSpaces, convertToHtmlUnicodeEscapes)
Returns the escaped markup text (HTML/XML).{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringFormat]\(text_to_format, parameters_array)
Formats a string according to format specifiers and arguments.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringIndexReplace]\(textString, i_start, i_size, replacement_text)
Replaces a portion of a string with replacement text from a specfied index.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringInitCap]\(text)
Returns all words starting with capital chars.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringLeft]\(textString, i_size)
Returns a string with the requested number of characters, starting from the left.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringLeftWords]\(text, numberof_words)
Returns the number of words, starting from the left.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringMD5HashBase16]\(textString)
Returns the md5 hash (encoded as base16) for specified text.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringMD5HashBase64]\(textString)
Returns the md5 hash (encoded as base64) for specified text.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringMiddle]\(textString, i_start, i_size)
Returns a substring from the original string.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringMiddleWords]\(text, i_start, numberof_words)
Returns a substring from the original string.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#stringPatternCount]\(textString, searchString)
Returns the number of times searchString appears in textString.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#stringPosition]\(textString, searchString, i_start, i_occurrence)
Returns the position of the string to seach for, from a certain start position and occurrence.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringReplace]\(text, search_text, replacement_text)
Replaces a portion of a string with replacement text.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringReplaceTags]\(text, foundset_or_record)
Returns the text with % %tags%% replaced, based on provided record or foundset.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringRight]\(textString, i_size)
Returns a string with the requested number of characters, starting from the right.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringRightWords]\(text, numberof_words)
Returns the number of words, starting from the right.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#stringToNumber]\(textString)
Filters characters out of from a string and leaves digits, returns the number.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#stringTrim]\(textString)
Returns the string without leading or trailing spaces.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#stringWordCount]\(textString)
Returns the number of words in the text string.{td}{tr}{tbody}{tbody}{tr}{td}[Date]{td}{td}[#timestampToDate]\(date)
Returns a datestamp from the timestamp (sets hours,minutes,seconds and milliseconds to 0).{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133}{tr:id=name}{td}h6.dateFormat{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object{span}{span:id=iets|style=float: left; font-weight: bold;}dateFormat{span}{span:id=iets|style=float: left;}\(date, format){span}{td}{tr}{tr:id=des}{td}{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_des|text=|trigger=button}{sub-section}{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_des|trigger=none|class=sIndent}Format a date object to a text representation or a parses a datestring to a date object.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_prs|trigger=none}date -- the date as text or date object
format -- the format to output or parse the to date
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_ret|text=|trigger=button}{sub-section}{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_ret|trigger=none|class=sIndent}Object -- the date as text or date object{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_see|text=|trigger=button}{sub-section}{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_see|text=|trigger=button}{sub-section}{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_sam|text=|trigger=button}{sub-section}{sub-section:CBD7EAD3-F0C2-42D7-9FB2-221C1E8A1133_sam|class=sIndent|trigger=none}{code:language=javascript}
var parsedDate = utils.dateFormat(datestring,'EEE, d MMM yyyy HH:mm:ss');
var formattedDateString = utils.dateFormat(dateobject,'EEE, d MMM yyyy HH:mm:ss');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=44806380-209B-4D98-B702-B9B78A73CB24}{tr:id=name}{td}h6.getUnicodeCharacter{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getUnicodeCharacter{span}{span:id=iets|style=float: left;}\(unicodeCharacterNumber){span}{td}{tr}{tr:id=des}{td}{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_des|text=|trigger=button}{sub-section}{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_des|trigger=none|class=sIndent}Returns a string containing the character for the unicode number.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_prs|trigger=none}unicodeCharacterNumber -- the number indicating the unicode character
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_ret|text=|trigger=button}{sub-section}{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_ret|trigger=none|class=sIndent}[String] -- a string containing the unicode character{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_see|text=|trigger=button}{sub-section}{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_see|text=|trigger=button}{sub-section}{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_sam|text=|trigger=button}{sub-section}{sub-section:44806380-209B-4D98-B702-B9B78A73CB24_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns a big dot
var dot = utils.getUnicodeCharacter(9679);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=26731FBA-42A2-4F7E-92D7-B3AE131672A7}{tr:id=name}{td}h6.hasRecords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}hasRecords{span}{span:id=iets|style=float: left;}\(foundset_or_record, qualifiedRelationString){span}{td}{tr}{tr:id=des}{td}{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_des|text=|trigger=button}{sub-section}{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_des|trigger=none|class=sIndent}Returns true if the (related)foundset exists and has records.
Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_prs|trigger=none}foundset_or_record -- the foundset or record to be tested
\[qualifiedRelationString\] -- the qualified relation string to reach a related foundset if a record is passes as first paramter
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_ret|text=|trigger=button}{sub-section}{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_ret|trigger=none|class=sIndent}[Boolean] -- true if exists{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_see|text=|trigger=button}{sub-section}{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_see|text=|trigger=button}{sub-section}{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_sam|text=|trigger=button}{sub-section}{sub-section:26731FBA-42A2-4F7E-92D7-B3AE131672A7_sam|class=sIndent|trigger=none}{code:language=javascript}
//test the orders_to_orderitems foundset
if (elements.customer_id.hasRecords(orders_to_orderitems))
{
//do work on relatedFoundSet
}
//test the orders_to_orderitems.orderitems_to_products foundset to be reached from the current record
//if (elements.customer_id.hasRecords(foundset.getSelectedRecord(),'orders_to_orderitems.orderitems_to_products'))
//{
// //do work on deeper relatedFoundSet
//}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=EC9E398B-8386-49C2-A50B-F522ECB36FB6}{tr:id=name}{td}h6.isMondayFirstDayOfWeek{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isMondayFirstDayOfWeek{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_des|text=|trigger=button}{sub-section}{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_des|trigger=none|class=sIndent}Returns true when Monday is the first day of the week for your current locale setting.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_ret|text=|trigger=button}{sub-section}{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_ret|trigger=none|class=sIndent}[Boolean] -- true if Monday is first day of the week in current locale{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_see|text=|trigger=button}{sub-section}{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_see|text=|trigger=button}{sub-section}{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_sam|text=|trigger=button}{sub-section}{sub-section:EC9E398B-8386-49C2-A50B-F522ECB36FB6_sam|class=sIndent|trigger=none}{code:language=javascript}
if(utils.isMondayFirstDayOfWeek())
{
//a date calculation
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8118762F-A3B3-4B56-AEBA-83938D8354B0}{tr:id=name}{td}h6.numberFormat{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}numberFormat{span}{span:id=iets|style=float: left;}\(number, digitsOrFormat){span}{td}{tr}{tr:id=des}{td}{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_des|text=|trigger=button}{sub-section}{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_des|trigger=none|class=sIndent}Format a number to specification (or to have a defined fraction).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_prs|trigger=none}number -- the number to format
digitsOrFormat -- the format or digits
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_ret|text=|trigger=button}{sub-section}{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_ret|trigger=none|class=sIndent}[String] -- the resulting number in text{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_see|text=|trigger=button}{sub-section}{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_see|text=|trigger=button}{sub-section}{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_sam|text=|trigger=button}{sub-section}{sub-section:8118762F-A3B3-4B56-AEBA-83938D8354B0_sam|class=sIndent|trigger=none}{code:language=javascript}
var textalNumber = utils.numberFormat(16.749, 2); //returns 16.75
var textalNumber2 = utils.numberFormat(100006.749, '#,###.00'); //returns 100,006.75
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=2FB1A7B4-3286-4552-808A-B893518ADD62}{tr:id=name}{td}h6.stringEscapeMarkup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringEscapeMarkup{span}{span:id=iets|style=float: left;}\(textString, escapeSpaces, convertToHtmlUnicodeEscapes){span}{td}{tr}{tr:id=des}{td}{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_des|text=|trigger=button}{sub-section}{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_des|trigger=none|class=sIndent}Returns the escaped markup text (HTML/XML).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_prs|trigger=none}textString -- the text to process
\[escapeSpaces\] -- boolean indicating to escape spaces
\[convertToHtmlUnicodeEscapes\] -- boolean indicating to use unicode escapes
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_ret|text=|trigger=button}{sub-section}{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_ret|trigger=none|class=sIndent}[String] -- the escaped text{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_see|text=|trigger=button}{sub-section}{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_see|text=|trigger=button}{sub-section}{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_sam|text=|trigger=button}{sub-section}{sub-section:2FB1A7B4-3286-4552-808A-B893518ADD62_sam|class=sIndent|trigger=none}{code:language=javascript}
var escapedText = utils.stringEscapeMarkup('<html><body>escape me</body></html>')
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DC3E27CD-5227-45BE-B125-804ED0599CB0}{tr:id=name}{td}h6.stringFormat{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringFormat{span}{span:id=iets|style=float: left;}\(text_to_format, parameters_array){span}{td}{tr}{tr:id=des}{td}{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_des|text=|trigger=button}{sub-section}{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_des|trigger=none|class=sIndent}Formats a string according to format specifiers and arguments.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_prs|trigger=none}text_to_format -- the text to format
parameters_array -- the array with parameters
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_ret|text=|trigger=button}{sub-section}{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_ret|trigger=none|class=sIndent}[String] -- the formatted text{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_see|text=|trigger=button}{sub-section}{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_see|text=|trigger=button}{sub-section}{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_sam|text=|trigger=button}{sub-section}{sub-section:DC3E27CD-5227-45BE-B125-804ED0599CB0_sam|class=sIndent|trigger=none}{code:language=javascript}
// the format specifier has the syntax: %[argument_index$][flags][width][.precision]conversion
// argument index is 1$, 2$ ...
// flags is a set of characters that modify the output format
// typical values: '+'(The result will always include a sign), ','(The result will include locale-specific grouping separators)
// width is a non-negative decimal integer indicating the minimum number of characters to be written to the output
// precision is a non-negative decimal integer usually used to restrict the number of characters
// conversion is a character indicating how the argument should be formatted
// typical conversion values: b(boolean), s(string), c(character), d(decimal integer), f(floating number), t(prefix for date and time)
// Date/Time Conversions (used after 't' prefix):
// 'H' Hour of the day for the 24-hour clock, formatted as two digits with a leading zero as necessary i.e. 00 - 23.
// 'I' Hour for the 12-hour clock, formatted as two digits with a leading zero as necessary, i.e. 01 - 12.
// 'k' Hour of the day for the 24-hour clock, i.e. 0 - 23.
// 'l' Hour for the 12-hour clock, i.e. 1 - 12.
// 'M' Minute within the hour formatted as two digits with a leading zero as necessary, i.e. 00 - 59.
// 'S' Seconds within the minute, formatted as two digits with a leading zero as necessary, i.e. 00 - 60 ("60" is a special value required to support leap seconds).
// 'L' Millisecond within the second formatted as three digits with leading zeros as necessary, i.e. 000 - 999.
// 'p' Locale-specific morning or afternoon marker in lower case, e.g."am" or "pm". Use of the conversion prefix 'T' forces this output to upper case.
// 'z' RFC 822 style numeric time zone offset from GMT, e.g. -0800.
// 'Z' A string representing the abbreviation for the time zone.
// 'B' Locale-specific full month name, e.g. "January", "February".
// 'b' Locale-specific abbreviated month name, e.g. "Jan", "Feb".
// 'h' Same as 'b'.
// 'A' Locale-specific full name of the day of the week, e.g. "Sunday", "Monday"
// 'a' Locale-specific short name of the day of the week, e.g. "Sun", "Mon"
// 'C' Four-digit year divided by 100, formatted as two digits with leading zero as necessary, i.e. 00 - 99
// 'Y' Year, formatted as at least four digits with leading zeros as necessary, e.g. 0092 equals 92 CE for the Gregorian calendar.
// 'y' Last two digits of the year, formatted with leading zeros as necessary, i.e. 00 - 99.
// 'j' Day of year, formatted as three digits with leading zeros as necessary, e.g. 001 - 366 for the Gregorian calendar.
// 'm' Month, formatted as two digits with leading zeros as necessary, i.e. 01 - 13.
// 'd' Day of month, formatted as two digits with leading zeros as necessary, i.e. 01 - 31
// 'e' Day of month, formatted as two digits, i.e. 1 - 31.
// common compositions for date/time conversion
// 'R' Time formatted for the 24-hour clock as "%tH:%tM"
// 'T' Time formatted for the 24-hour clock as "%tH:%tM:%tS".
// 'r' Time formatted for the 12-hour clock as "%tI:%tM:%tS %Tp". The location of the morning or afternoon marker ('%Tp') may be locale-dependent.
// 'D' Date formatted as "%tm/%td/%ty".
// 'F' ISO 8601 complete date formatted as "%tY-%tm-%td".
// 'c' Date and time formatted as "%ta %tb %td %tT %tZ %tY", e.g. "Sun Jul 20 16:17:00 EDT 1969".
utils.stringFormat('%s Birthday: %2$tm %2$te,%2$tY',new Array('My',new Date(2009,0,1))) // returns My Birthday: 01 1,2009
utils.stringFormat('The time is: %1$tH:%1$tM:%1$tS',new Array(new Date(2009,0,1,12,0,0))) // returns The time is: 12:00:00
utils.stringFormat('My %s: %2$.0f, my float: %2$.2f',new Array('integer',10)) // returns My integer: 10, my float: 10.00
utils.stringFormat('Today is: %1$tc',new Array(new Date())) // returns current date/time as: Today is: Fri Feb 20 14:15:54 EET 2009
utils.stringFormat('Today is: %tF',new Array(new Date())) // returns current date as: Today is: 2009-02-20
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F}{tr:id=name}{td}h6.stringIndexReplace{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringIndexReplace{span}{span:id=iets|style=float: left;}\(textString, i_start, i_size, replacement_text){span}{td}{tr}{tr:id=des}{td}{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_des|text=|trigger=button}{sub-section}{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_des|trigger=none|class=sIndent}Replaces a portion of a string with replacement text from a specfied index.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_prs|trigger=none}textString -- the text to process
i_start -- the start index to work from
i_size -- the size of the text to replace
replacement_text -- the replacement text
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_ret|text=|trigger=button}{sub-section}{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_ret|trigger=none|class=sIndent}[String] -- the changed text string{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_see|text=|trigger=button}{sub-section}{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_see|text=|trigger=button}{sub-section}{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_sam|text=|trigger=button}{sub-section}{sub-section:FCD2CDC4-3DF0-4DA7-8F2A-7AD29EAACD4F_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'this was a test'
var retval = utils.stringIndexReplace('this is a test',6,2,'was');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6F933B81-FE31-423E-8ECC-1E931004369F}{tr:id=name}{td}h6.stringInitCap{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringInitCap{span}{span:id=iets|style=float: left;}\(text){span}{td}{tr}{tr:id=des}{td}{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_des|text=|trigger=button}{sub-section}{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_des|trigger=none|class=sIndent}Returns all words starting with capital chars.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_prs|trigger=none}text -- the text to process
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_ret|text=|trigger=button}{sub-section}{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_ret|trigger=none|class=sIndent}[String] -- the changed text{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_see|text=|trigger=button}{sub-section}{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_see|text=|trigger=button}{sub-section}{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_sam|text=|trigger=button}{sub-section}{sub-section:6F933B81-FE31-423E-8ECC-1E931004369F_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'This Is A Test'
var retval = utils.stringInitCap('This is A test');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B9D43127-0843-4FA5-9269-1607CBD5C5C8}{tr:id=name}{td}h6.stringLeft{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringLeft{span}{span:id=iets|style=float: left;}\(textString, i_size){span}{td}{tr}{tr:id=des}{td}{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_des|text=|trigger=button}{sub-section}{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_des|trigger=none|class=sIndent}Returns a string with the requested number of characters, starting from the left.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_prs|trigger=none}textString -- the text to process
i_size -- the size of the text to return
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_ret|text=|trigger=button}{sub-section}{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_ret|trigger=none|class=sIndent}[String] -- the result text string{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_see|text=|trigger=button}{sub-section}{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_see|text=|trigger=button}{sub-section}{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_sam|text=|trigger=button}{sub-section}{sub-section:B9D43127-0843-4FA5-9269-1607CBD5C5C8_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'this i'
var retval = utils.stringLeft('this is a test',6);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=02897075-11B2-462A-BBAC-D00199532586}{tr:id=name}{td}h6.stringLeftWords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringLeftWords{span}{span:id=iets|style=float: left;}\(text, numberof_words){span}{td}{tr}{tr:id=des}{td}{sub-section:02897075-11B2-462A-BBAC-D00199532586_des|text=|trigger=button}{sub-section}{sub-section:02897075-11B2-462A-BBAC-D00199532586_des|trigger=none|class=sIndent}Returns the number of words, starting from the left.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:02897075-11B2-462A-BBAC-D00199532586_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:02897075-11B2-462A-BBAC-D00199532586_prs|trigger=none}text -- to process
numberof_words -- to return
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:02897075-11B2-462A-BBAC-D00199532586_ret|text=|trigger=button}{sub-section}{sub-section:02897075-11B2-462A-BBAC-D00199532586_ret|trigger=none|class=sIndent}[String] -- the string with number of words form the left{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:02897075-11B2-462A-BBAC-D00199532586_see|text=|trigger=button}{sub-section}{sub-section:02897075-11B2-462A-BBAC-D00199532586_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:02897075-11B2-462A-BBAC-D00199532586_see|text=|trigger=button}{sub-section}{sub-section:02897075-11B2-462A-BBAC-D00199532586_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:02897075-11B2-462A-BBAC-D00199532586_sam|text=|trigger=button}{sub-section}{sub-section:02897075-11B2-462A-BBAC-D00199532586_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'this is a'
var retval = utils.stringLeftWords('this is a test',3);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0C47F265-CD2E-4B1A-98E1-DF12C9E465F6}{tr:id=name}{td}h6.stringMD5HashBase16{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringMD5HashBase16{span}{span:id=iets|style=float: left;}\(textString){span}{td}{tr}{tr:id=des}{td}{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_des|text=|trigger=button}{sub-section}{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_des|trigger=none|class=sIndent}Returns the md5 hash (encoded as base16) for specified text.
NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_prs|trigger=none}textString -- the text to process
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_ret|text=|trigger=button}{sub-section}{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_ret|trigger=none|class=sIndent}[String] -- the resulting hashString{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_see|text=|trigger=button}{sub-section}{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_see|text=|trigger=button}{sub-section}{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_sam|text=|trigger=button}{sub-section}{sub-section:0C47F265-CD2E-4B1A-98E1-DF12C9E465F6_sam|class=sIndent|trigger=none}{code:language=javascript}
var hashed_password = utils.stringMD5HashBase16(user_password)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4}{tr:id=name}{td}h6.stringMD5HashBase64{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringMD5HashBase64{span}{span:id=iets|style=float: left;}\(textString){span}{td}{tr}{tr:id=des}{td}{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_des|text=|trigger=button}{sub-section}{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_des|trigger=none|class=sIndent}Returns the md5 hash (encoded as base64) for specified text.
NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_prs|trigger=none}textString -- the text to process
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_ret|text=|trigger=button}{sub-section}{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_ret|trigger=none|class=sIndent}[String] -- the resulting hashString{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_see|text=|trigger=button}{sub-section}{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_see|text=|trigger=button}{sub-section}{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_sam|text=|trigger=button}{sub-section}{sub-section:DCFFF8B1-762A-4BA6-89FE-7F1F18D522F4_sam|class=sIndent|trigger=none}{code:language=javascript}
var hashed_password = utils.stringMD5HashBase64(user_password)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7EBC6732-B711-4776-8C20-D67259F5B171}{tr:id=name}{td}h6.stringMiddle{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringMiddle{span}{span:id=iets|style=float: left;}\(textString, i_start, i_size){span}{td}{tr}{tr:id=des}{td}{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_des|text=|trigger=button}{sub-section}{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_des|trigger=none|class=sIndent}Returns a substring from the original string.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_prs|trigger=none}textString -- the text to process
i_start -- the start index to work from
i_size -- the size of the text to return
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_ret|text=|trigger=button}{sub-section}{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_ret|trigger=none|class=sIndent}[String] -- the result text string{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_see|text=|trigger=button}{sub-section}{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_see|text=|trigger=button}{sub-section}{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_sam|text=|trigger=button}{sub-section}{sub-section:7EBC6732-B711-4776-8C20-D67259F5B171_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'his'
var retval = utils.stringMiddle('this is a test',2,3);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9E298B89-E21D-4C77-A5BA-20BF51F48984}{tr:id=name}{td}h6.stringMiddleWords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringMiddleWords{span}{span:id=iets|style=float: left;}\(text, i_start, numberof_words){span}{td}{tr}{tr:id=des}{td}{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_des|text=|trigger=button}{sub-section}{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_des|trigger=none|class=sIndent}Returns a substring from the original string.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_prs|trigger=none}text -- to process
i_start -- start word index
numberof_words -- the word count to return
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_ret|text=|trigger=button}{sub-section}{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_ret|trigger=none|class=sIndent}[String] -- the string with number of words form the left and{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_see|text=|trigger=button}{sub-section}{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_see|text=|trigger=button}{sub-section}{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_sam|text=|trigger=button}{sub-section}{sub-section:9E298B89-E21D-4C77-A5BA-20BF51F48984_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'is a'
var retval = utils.stringMiddleWords('this is a test',2,2);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=C66D76BD-9878-466D-AE91-132DC465F0A4}{tr:id=name}{td}h6.stringPatternCount{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}stringPatternCount{span}{span:id=iets|style=float: left;}\(textString, searchString){span}{td}{tr}{tr:id=des}{td}{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_des|text=|trigger=button}{sub-section}{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_des|trigger=none|class=sIndent}Returns the number of times searchString appears in textString.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_prs|trigger=none}textString -- the text to process
searchString -- the string to search
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_ret|text=|trigger=button}{sub-section}{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_ret|trigger=none|class=sIndent}[Number] -- the occurrenceCount that the search string is found in the text{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_see|text=|trigger=button}{sub-section}{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_see|text=|trigger=button}{sub-section}{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_sam|text=|trigger=button}{sub-section}{sub-section:C66D76BD-9878-466D-AE91-132DC465F0A4_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 2 as count
var count = utils.stringPatternCount('this is a test','is');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=AE70BE3A-BA68-4949-B900-6EC1AC83E573}{tr:id=name}{td}h6.stringPosition{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}stringPosition{span}{span:id=iets|style=float: left;}\(textString, searchString, i_start, i_occurrence){span}{td}{tr}{tr:id=des}{td}{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_des|text=|trigger=button}{sub-section}{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_des|trigger=none|class=sIndent}Returns the position of the string to seach for, from a certain start position and occurrence.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_prs|trigger=none}textString -- the text to process
searchString -- the string to search
i_start -- the start index to search from
i_occurrence -- the occurrence
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_ret|text=|trigger=button}{sub-section}{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_ret|trigger=none|class=sIndent}[Number] -- the position{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_see|text=|trigger=button}{sub-section}{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_see|text=|trigger=button}{sub-section}{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_sam|text=|trigger=button}{sub-section}{sub-section:AE70BE3A-BA68-4949-B900-6EC1AC83E573_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 4 as position
var pos = utils.stringPosition('This is a test','s',1,1)
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=648DDD25-C317-49F1-8687-B7E22D765107}{tr:id=name}{td}h6.stringReplace{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringReplace{span}{span:id=iets|style=float: left;}\(text, search_text, replacement_text){span}{td}{tr}{tr:id=des}{td}{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_des|text=|trigger=button}{sub-section}{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_des|trigger=none|class=sIndent}Replaces a portion of a string with replacement text.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_prs|trigger=none}text -- the text to process
search_text -- the string to search
replacement_text -- the replacement text
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_ret|text=|trigger=button}{sub-section}{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_ret|trigger=none|class=sIndent}[String] -- the changed text string{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_see|text=|trigger=button}{sub-section}{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_see|text=|trigger=button}{sub-section}{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_sam|text=|trigger=button}{sub-section}{sub-section:648DDD25-C317-49F1-8687-B7E22D765107_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'these are cow 1 and cow 2.'
var retval = utils.stringReplace('these are test 1 and test 2.','test','cow');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=5D07A593-13B3-45E8-892B-096FA3B17821}{tr:id=name}{td}h6.stringReplaceTags{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringReplaceTags{span}{span:id=iets|style=float: left;}\(text, foundset_or_record){span}{td}{tr}{tr:id=des}{td}{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_des|text=|trigger=button}{sub-section}{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_des|trigger=none|class=sIndent}Returns the text with % %tags%% replaced, based on provided record or foundset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_prs|trigger=none}text -- the text tags to work with
foundset_or_record -- the foundset or record to be used to fill in the tags
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_ret|text=|trigger=button}{sub-section}{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_ret|trigger=none|class=sIndent}[String] -- the text with replaced tags{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_see|text=|trigger=button}{sub-section}{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_see|text=|trigger=button}{sub-section}{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_sam|text=|trigger=button}{sub-section}{sub-section:5D07A593-13B3-45E8-892B-096FA3B17821_sam|class=sIndent|trigger=none}{code:language=javascript}
//Next line places a string in variable x, whereby the tag(% %TAG%%) is filled with the value of the database column 'company_name' of the selected record.
var x = utils.stringReplaceTags("The companyName of the selected record is % %company_name%% ", foundset)
//var otherExample = utils.stringReplaceTags("The amount of the related order line % %amount%% ", order_to_orderdetails);
//var recordExample = utils.stringReplaceTags("The amount of the related order line % %amount%% ", order_to_orderdetails.getRecord(i);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=691C63E7-4702-49D5-9545-31927D469735}{tr:id=name}{td}h6.stringRight{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringRight{span}{span:id=iets|style=float: left;}\(textString, i_size){span}{td}{tr}{tr:id=des}{td}{sub-section:691C63E7-4702-49D5-9545-31927D469735_des|text=|trigger=button}{sub-section}{sub-section:691C63E7-4702-49D5-9545-31927D469735_des|trigger=none|class=sIndent}Returns a string with the requested number of characters, starting from the right.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:691C63E7-4702-49D5-9545-31927D469735_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:691C63E7-4702-49D5-9545-31927D469735_prs|trigger=none}textString -- the text to process
i_size -- the size of the text to return
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:691C63E7-4702-49D5-9545-31927D469735_ret|text=|trigger=button}{sub-section}{sub-section:691C63E7-4702-49D5-9545-31927D469735_ret|trigger=none|class=sIndent}[String] -- the result text string{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:691C63E7-4702-49D5-9545-31927D469735_see|text=|trigger=button}{sub-section}{sub-section:691C63E7-4702-49D5-9545-31927D469735_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:691C63E7-4702-49D5-9545-31927D469735_see|text=|trigger=button}{sub-section}{sub-section:691C63E7-4702-49D5-9545-31927D469735_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:691C63E7-4702-49D5-9545-31927D469735_sam|text=|trigger=button}{sub-section}{sub-section:691C63E7-4702-49D5-9545-31927D469735_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'a test'
var retval = utils.stringLeft('this is a test',6);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8014385A-8DCA-4615-9744-1CFFDF55C047}{tr:id=name}{td}h6.stringRightWords{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringRightWords{span}{span:id=iets|style=float: left;}\(text, numberof_words){span}{td}{tr}{tr:id=des}{td}{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_des|text=|trigger=button}{sub-section}{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_des|trigger=none|class=sIndent}Returns the number of words, starting from the right.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_prs|trigger=none}text -- to process
numberof_words -- to return
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_ret|text=|trigger=button}{sub-section}{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_ret|trigger=none|class=sIndent}[String] -- the string with number of words form the right{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_see|text=|trigger=button}{sub-section}{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_see|text=|trigger=button}{sub-section}{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_sam|text=|trigger=button}{sub-section}{sub-section:8014385A-8DCA-4615-9744-1CFFDF55C047_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'is a test'
var retval = utils.stringRightWords('this is a test',3);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7B167173-7BD6-4AE5-A32E-537AB5A8C92D}{tr:id=name}{td}h6.stringToNumber{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}stringToNumber{span}{span:id=iets|style=float: left;}\(textString){span}{td}{tr}{tr:id=des}{td}{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_des|text=|trigger=button}{sub-section}{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_des|trigger=none|class=sIndent}Filters characters out of from a string and leaves digits, returns the number.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_prs|trigger=none}textString -- the text to process
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_ret|text=|trigger=button}{sub-section}{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_ret|trigger=none|class=sIndent}[Number] -- the resulting number{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_see|text=|trigger=button}{sub-section}{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_see|text=|trigger=button}{sub-section}{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_sam|text=|trigger=button}{sub-section}{sub-section:7B167173-7BD6-4AE5-A32E-537AB5A8C92D_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns '65567'
var retval = utils.stringToNumber('fg65gf567');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=ABAD518C-604E-4D60-BB88-0F342BEB6D77}{tr:id=name}{td}h6.stringTrim{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}stringTrim{span}{span:id=iets|style=float: left;}\(textString){span}{td}{tr}{tr:id=des}{td}{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_des|text=|trigger=button}{sub-section}{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_des|trigger=none|class=sIndent}Returns the string without leading or trailing spaces.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_prs|trigger=none}textString -- the text to process
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_ret|text=|trigger=button}{sub-section}{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_ret|trigger=none|class=sIndent}[String] -- the resulting trimmed string{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_see|text=|trigger=button}{sub-section}{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_see|text=|trigger=button}{sub-section}{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_sam|text=|trigger=button}{sub-section}{sub-section:ABAD518C-604E-4D60-BB88-0F342BEB6D77_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns 'text'
var retval = utils.stringTrim(' text ');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236}{tr:id=name}{td}h6.stringWordCount{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}stringWordCount{span}{span:id=iets|style=float: left;}\(textString){span}{td}{tr}{tr:id=des}{td}{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_des|text=|trigger=button}{sub-section}{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_des|trigger=none|class=sIndent}Returns the number of words in the text string.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_prs|trigger=none}textString -- the text to process
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_ret|text=|trigger=button}{sub-section}{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_ret|trigger=none|class=sIndent}[Number] -- the word count{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_see|text=|trigger=button}{sub-section}{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_see|text=|trigger=button}{sub-section}{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_sam|text=|trigger=button}{sub-section}{sub-section:168FD3F9-F7E3-4EAB-87A7-E4B7EDAFC236_sam|class=sIndent|trigger=none}{code:language=javascript}
//returns '4' as result
var retval = utils.stringWordCount('this is a test');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3C1A5A36-8A27-4620-81E6-FCFD3107EDD0}{tr:id=name}{td}h6.timestampToDate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Date]{span}{span:id=iets|style=float: left; font-weight: bold;}timestampToDate{span}{span:id=iets|style=float: left;}\(date){span}{td}{tr}{tr:id=des}{td}{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_des|text=|trigger=button}{sub-section}{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_des|trigger=none|class=sIndent}Returns a datestamp from the timestamp (sets hours,minutes,seconds and milliseconds to 0).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_prs|trigger=none}date -- object to be stripped from its time elements
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_ret|text=|trigger=button}{sub-section}{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_ret|trigger=none|class=sIndent}[Date] -- the stripped date object{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_see|text=|trigger=button}{sub-section}{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_see|text=|trigger=button}{sub-section}{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_sam|text=|trigger=button}{sub-section}{sub-section:3C1A5A36-8A27-4620-81E6-FCFD3107EDD0_sam|class=sIndent|trigger=none}{code:language=javascript}
var date = utils.timestampToDate(application.getTimeStamp());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClientservoy sSummary12%30%58%height: 30px;3Methods SummaryReturn the byte array representation of the Base64 valueReturn the String representation of the Base64 valueReturn the Base64 value representation of the byteArrayReturn the string conversion of the byteArrayFormat a date object to a text representation.Format a date object to a text representation using the format and timezone given.Format a date object to a text representation.Format a date object to a text representation using the format, timezone, language and country given.Returns a string containing the character for the unicode number.Returns true if the (related)foundset exists and has records.Returns true if the (related)foundset exists and has records.Returns true when Monday is the first day of the week for your current locale setting.Format a number to have a defined fraction.Format a number to have a defined fraction.Format a number to specification.Format a number to specification.Parse a string to a date object.Parse a string to a date object.Parse a string to a date object.Parse a string to a date object.Returns the escaped markup text (HTML/XML).Returns the escaped markup text (HTML/XML).Returns the escaped markup text (HTML/XML).Formats a string according to format specifiers and arguments.Format a string using mask.Replaces a portion of a string with replacement text from a specified index.Returns all words starting with capital chars.Returns a string with the requested number of characters, starting from the left.Returns the number of words, starting from the left.Returns the md5 hash (encoded as base16) for specified text.Returns the md5 hash (encoded as base64) for specified text.Returns a substring from the original string.Returns a substring from the original string.Returns the PBKDF2 hash for specified text.Returns the PBKDF2 hash for specified text.Returns the number of times searchString appears in textString.Returns the position of the string to search for, from a certain start position and occurrence.Replaces a portion of a string with replacement text.Returns the text with %%tags%% replaced, based on provided record or foundset or form.Returns a string with the requested number of characters, starting from the right.Returns the number of words, starting from the right.Return the Base64 representation of the stringReturn the byte array representation of the stringFilters characters out of from a string and leaves digits, returns the number.Filters characters out of from a string and leaves digits, returns the number.Returns the string without leading or trailing spaces.Returns the number of words in the text string.Returns a datestamp from the timestamp (sets hours,minutes,seconds and milliseconds to 0).Validates the given password against the given hash.functionservoy sDetail2100%height:30px2Methods Detailsbase64ToBytesname
base64ToBytes(base64String:)
dessIndent
Return the byte array representation of the Base64 value
prs
Parameters
sIndentbase64String:the Base64 encoded string to convert to byte arrayret
Returns
sIndent byteArray representation of the base64 string using UTF-8 charset for conversionclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowbase64ToStringname
base64ToString(base64String:)
dessIndent
Return the String representation of the Base64 value
prs
Parameters
sIndentbase64String:the Base64 value to convert to Stringret
Returns
sIndent String decoded representation of the Base64 value using UTF-8 charset for conversionclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowbytesToBase64name
bytesToBase64(byteArray:)
dessIndent
Return the Base64 value representation of the byteArray
prs
Parameters
sIndentbyteArray:the byte array to convert to Base64 valueret
Returns
sIndent Base64 representation of the byte array using UTF-8 charset for conversionclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowbytesToHexname
bytesToHex(bytearray)
dessIndentprs
Parameters
sIndentbytearraythe byte array to convert to hex encoded stringret
Returns
sIndent returns hex encoded string from bytearrayclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowbytesToStringname
bytesToString(byteArray:)
dessIndent
Return the string conversion of the byteArray
prs
Parameters
sIndentbyteArray:the byte array to convert toret
Returns
sIndent string representation of the byte array using UTF-8 charset for conversionclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowdateFormatname
dateFormat(date, format)
dessIndent
Format a date object to a text representation.
This will format with the system timezone for the webclient
For NGClient it will use the timezone of the client, the same goes for the Smartclient (but that is the system timezone)
see #dateFormat(Date,String,String) for using the actual clients timezone.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'.
Symbols meaning is:
G era designator
y year
Y week year
M month in year
d day in month
h hour in am/pm (1~12)
H hour in day (0~23)
m minute in hour
s second in minute
S millisecond
E day in week
D day in year
F day of week in month
w week in year
W week in month
a am/pm marker
z time zone
k hour in day (1~24)
K hour in am/pm (0~11)
Format a date object to a text representation using the format and timezone given.
If the timezone is not given the timezone of the client itself will be used.
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Symbols meaning is:
G era designator
y year
Y week year
M month in year
d day in month
h hour in am/pm (1~12)
H hour in day (0~23)
m minute in hour
s second in minute
S millisecond
E day in week
D day in year
F day of week in month
w week in year
W week in month
a am/pm marker
z time zone
k hour in day (1~24)
K hour in am/pm (0~11)
prs
Parameters
sIndentdatethe dateformatthe format to outputtimezoneThe timezone string to use to parse the date (like GMT+3), if null then the timezone of the current client is used.ret
Returns
sIndent the date as textclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowdateFormatname
dateFormat(date, format, language, country)
dessIndent
Format a date object to a text representation.
This will format with the system timezone for the webclient
With language and/or country the locale will be created.
For NGClient it will use the timezone of the client, the same goes for the Smartclient (but that is the system timezone)
see #dateFormat(Date,String,String) for using the actual clients timezone.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'.
Symbols meaning is:
G era designator
y year
Y week year
M month in year
d day in month
h hour in am/pm (1~12)
H hour in day (0~23)
m minute in hour
s second in minute
S millisecond
E day in week
D day in year
F day of week in month
w week in year
W week in month
a am/pm marker
z time zone
k hour in day (1~24)
K hour in am/pm (0~11)
prs
Parameters
sIndentdatethe dateformatthe format to outputlanguagelanguage used to create localecountrycountry used along side language to create the localeret
Returns
sIndent the date as textclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowdateFormatname
dateFormat(date, format, timezone, language, country)
dessIndent
Format a date object to a text representation using the format, timezone, language and country given.
With the language and country given, the locale will be created.
If the timezone is not given the timezone of the client itself will be used.
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
Symbols meaning is:
G era designator
y year
Y week year
M month in year
d day in month
h hour in am/pm (1~12)
H hour in day (0~23)
m minute in hour
s second in minute
S millisecond
E day in week
D day in year
F day of week in month
w week in year
W week in month
a am/pm marker
z time zone
k hour in day (1~24)
K hour in am/pm (0~11)
prs
Parameters
sIndentdatethe dateformatthe format to outputtimezonethe timezone to use the format, if null then current client timezone is used.languagelanguage used to create localecountrycountry used along side language to create the localeret
Returns a string containing the character for the unicode number.
prs
Parameters
sIndentunicodeCharacterNumberthe number indicating the unicode characterret
Returns
sIndent a string containing the unicode characterclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowhasRecordsname
hasRecords(foundset)
dessIndent
Returns true if the (related)foundset exists and has records.
Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
Returns true if the (related)foundset exists and has records.
Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
prs
Parameters
sIndentrecordA JSRecord to test.relationStringThe relation name.ret
Returns
sIndent true if the foundset/relation has records.clients
sIndentnumberthe number to formatdigitsnr of digitslanguagelanguage used to create localecountrycountry used along side language to create the localeret
Returns
sIndent the resulting number in textclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRownumberFormatname
numberFormat(number, format)
dessIndent
Format a number to specification.
prs
Parameters
sIndentnumberthe number to formatformatthe formatret
sIndentnumberthe number to formatformatthe formatlanguagelanguage used to create localecountrycountry used along side language to create the localeret
Returns
sIndent the resulting number in textclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowparseDatename
parseDate(date, format)
dessIndent
Parse a string to a date object. This parses the date using the TimeZone of the server
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs
Parameters
sIndentdatethe date as textformatthe format to parse the dateret
Returns
sIndent the date as date objectclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowparseDatename
parseDate(date, format, timezone)
dessIndent
Parse a string to a date object. Using the timezone that is given, if null then it formats it with the clients timezone.
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs
Parameters
sIndentdatethe date as textformatthe format to parse the datetimezoneThe timezone string to use to parse the date (like GMT+3)ret
Returns
sIndent the date as date objectclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowparseDatename
parseDate(date, format, language, country)
dessIndent
Parse a string to a date object. Using language and country that are given,
if null then it formats it with the locale of the client
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs
Parameters
sIndentdatethe date as textformatthe format to parse the datelanguagelanguage used to create localecountrycountry used along side language to create the localeret
Returns
sIndent the date as date objectclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowparseDatename
parseDate(date, format, timezone, language, country)
dessIndent
Parse a string to a date object. Using the timezone, language and country that are given,
if null then it formats it with the timezone and locale of the client
see i18n.getAvailableTimeZoneIDs() to get a timezone string that can be used.
Format can be a string like: 'dd-MM-yyyy' , 'dd-MM-yyyy HH:mm' , 'MM/dd/yyyy', 'MM/dd/yyyy hh:mm aa', 'dd.MM.yyyy'
prs
Parameters
sIndentdatethe date as textformatthe format to parse the datetimezoneThe timezone string to use to parse the date (like GMT+3)languagelanguage used to create localecountrycountry used along side language to create the localeret
Returns the md5 hash (encoded as base16) for specified text.
NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5
Returns the md5 hash (encoded as base64) for specified text.
NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5
prs
Parameters
sIndenttextStringthe text to processret
Returns
sIndent the resulting hashStringclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowstringMiddlename
stringMiddle(text, i_start, i_size)
dessIndent
Returns a substring from the original string.
prs
Parameters
sIndenttextthe text to processi_startthe start index to work fromi_sizethe size of the text to returnret
sIndenttextto processi_startstart word indexnumberof_wordsthe word count to returnret
Returns
sIndent the string with number of words form the left andclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowstringPBKDF2Hashname
stringPBKDF2Hash(textString)
dessIndent
Returns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security.
It uses a default of 9999 iterations. The string that is returned can only be used in the utils.validatePBKDF2Hash(password,thisReturnValue)
to check if this hash is a result of that password.
This will always be false: utils.stringPBKDF2Hash("test") == utils.stringPBKDF2Hash("test"). Because for the same string in multiply calls it will not generate the same hash.
So you can only check it like this: utils.validatePBKDF2Hash("test",utils.stringPBKDF2Hash("test"))
NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2
prs
Parameters
sIndenttextStringthe text to processret
Returns
sIndent the resulting hashStringclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowstringPBKDF2Hashname
stringPBKDF2Hash(textString, iterations)
dessIndent
Returns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security.
NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2
prs
Parameters
sIndenttextStringthe text to processiterationshow many hash iterations should be done, minimum should be 1000 or higher.ret
Validates the given password against the given hash. The hash should be generated by one of the stringPBKDF2Hash(password [,iteration]) functions. If hash is null or empty string the method will return false.
NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2
prs
Parameters
sIndentpasswordthe password to test againsthashthe hash the password needs to validate to.ret
Returns
sIndent true if his hash is valid for that passwordclients