val

Converts numeric characters that occur at the beginning of a
string to a number. If conversion fails, returns zero.

val(String) → returns numeric

val Argument Reference

String string
Required

A string or a variable that contains one

Examples sample code invoking the val function

val("120test12sstring");

Expected Result: 120

val("string98");

Expected Result: 0


Fork me on GitHub