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.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 specification.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 DetailsdateFormatbase64ToBytesnamedateFormat(date, format
base64ToBytes(base64String:)
dessIndentFormat
Return
a
the
date
byte
object
array
to
representation
a
of
text representation.
This will format with the system timezone, so for web and ng clients it will use the server timezone to format
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
the Base64 value
prs
Parameters
sIndentbase64String:the Base64 encoded string to convert to byte arrayret
Returns
sIndentclients
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
sIndentclients
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
sIndentclients
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
sIndentclients
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, so for web and ng clients it will use the server timezone to format
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 to use the format, if null then current client timezone is used.ret
Returns a string containing the character for the unicode number.
prs
Parameters
sIndentunicodeCharacterNumberthe number indicating the unicode characterret
Returns
sIndentclients
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 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
sIndentclients
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
sIndentclients
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
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
sIndentclients
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
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.
toSearchFor, i_start, i_occurrence)
dessIndent
Returns the position of the string to search for, from a certain start position and occurrence.
prs
Parameters
sIndenttextStringthe text to processtoSearchForthe string to searchi_startthe start index to search fromi_occurrencethe occurrenceret
sIndenttextStringtextthe text tags to processtoSearchForthe string to searchi_startthe start index to search fromi_occurrencethe occurrencework withscriptablethe javascript object or foundset,record,form to be used to fill in the tagsret
sIndenttexttexttags to work withscriptablethe javascript object or foundset,record,form to be used to fill in the tagsto processnumberof_wordsto returnret
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