Guys,
This one is probably quite easy but I just don't know how to do it. This is basically what I want to do ( in rough pseudocode ).
A string and a character are passed to this js function:
function validNumber(string, firstChar) {
if (first char of string == firstChar) {
verify that from second char of string to end is a number
}
else {
verify that string is a number
}
}
I know that I can use isNan to verify whether or not a variable is numeric or not. It's just the fact that I have to check the first character. Can you please tell me if this can easily be done. Mise Le Meas,
Mighty
This one is probably quite easy but I just don't know how to do it. This is basically what I want to do ( in rough pseudocode ).
A string and a character are passed to this js function:
function validNumber(string, firstChar) {
if (first char of string == firstChar) {
verify that from second char of string to end is a number
}
else {
verify that string is a number
}
}
I know that I can use isNan to verify whether or not a variable is numeric or not. It's just the fact that I have to check the first character. Can you please tell me if this can easily be done. Mise Le Meas,
Mighty