Summary: Random functions for creating, manipulating and analyzing strings.
Function | Summary |
isNum |
Is the provided string a legal number? |
isEml |
Is the provided string a properly-formatted email address? |
trmChr |
Trim all contiguous instances of the provided character from the ends of a string |
gtCd4V |
Get the provided value returned as a string, and suitable for insertion into code. |
util_string.js
: OverviewRandom functions for creating, manipulating and analyzing strings.
util_string
.isNum()
Is the provided string a legal number?
s_potential
: The string to analyze. REQUIREDbs_decimalAllowed
: Is the potential number allowed to be a decimal? If 'true', then yes. If 'false', no. REQUIRED.true
if...false
if otherwise-1
0
1
-50
8750328754
00008750328754
08750328754
-487584758475235
-0000000487584758475235
-0487584758475235
4875847-58475235
487584758475235-
[EMPTY_STRING]
a
0-
-0
Not a number!!!
Some 123 numbers 456
123 456
-0.0
-.0
-0.000000
-.000000
1.
1.1
1.000830847018374
058763408562473.01837486564417308746
.1
.0
.01
-1.0
isNum(s_potential, bs_decimalAllowed)
util_string
.isEml()
Is the provided string a properly-formatted email address?
A 'bad' email has any of the following characteruistics:
undefined
or zero characters in length.s_potentialEmail
: The string to check for email-ness. REQUIRED.true
if s_potentialEmail
false
if not.bla@bloo.com
bla.blee@bloo.blay.com
bla_blee@bloo_blay.com
x@x.x
x.x.x.x.x.@x.x.x.x.x.x.x.x.x
x
@
.
@@
..
@.
.@
bla @ bloo . com
[A SPACE]
bla@bloo.com
bla@bl oo.com
bla.@.bloo.com
bla@bloo.combla@bloo.com
isEml(s_potentialEmail)
util_string
.trmChr()
Trim all contiguous instances of the provided character from the ends of a string
c_harToTrim
: The character to trim off of s_tring
. REQUIRED and must be a character/string-of-length-one.s_tring
: The string to trim. REQUIRED.trmChr(c_harToTrim, s_tring)
util_string
.gtCd4V()
Get the provided value returned as a string, and suitable for insertion into code.
s_value
: The value to code-ize."undefined"
when s_value
is undefined.s_value
when s_value
is a number."['" + s_value.join("', '") + "']"
when s_value
is an array."'" + s_value + "'"
if otherwise.gtCd4V(s_value)
___RPLC___ vfjs_doc_footer ___RPLCZ___