-
Notifications
You must be signed in to change notification settings - Fork 0
Strings
-
Capitalize first letter in a word
'test'.capitalize()
result
"Test"
-
Capitalize all first letters of all word contained in a sentence separate by space
'test test Test test'.capitalizeAll()
result
"Test Test Test Test"
-
Convert
new Date
in european format dateString(new Date).getDateEU()
result
dd/mm/yyyy
-
Convert
new Date
in american format dateString(new Date).getDateUS()
result
mm/dd/yyyy
-
Convert Database formar date
2015-03-18T16:23:18.423Z
in european format date'2015-03-18T16:23:18.423Z'.getDbDate()
result
dd/mm/yyyy
-
Convert Database formar date
2015-03-18T16:23:18.423Z
in european format date and time'2015-03-18T16:23:18.423Z'.getDbDateTime()
result
dd/mm/yyyy - hh:mm:ss
-
Convert normal string in a html string
'Marco&Co'.htmlEscape()
result
Marco&Co
-
Convert html string in a normal string
'Marco&Co'.htmlUnescape()
result
Marco&Co
-
Repeat a word 'n' times
'test0'.repeat(3)
result
"test0test0test0"
-
Reverse a word
'test0'.reverseWord()
result
"0tset"
-
Return substring before an symbol
'test0.test1'.substringBeforeTo('.')
result
"test0"
-
Return substring after an symbol if the symbol is contained more times return an array
-
example 1
'test0.test1'.substringAfterTo('.')
result
"test1"
-
example 2
'test0.test1.test2.test3'.substringAfterTo('.')
result
["test1","test2","test3"]
-
-
Validate content in a string
-
example 1
'mak.so1979@gmail.com'.validateContent('email')
result
true
-
example 2
'mak.so1979gmailcom'.validateContent('email')
result
false
-