how to check whether it is a character or a number using javascript..?
Copy link to clipboard
Copied
Hi,
In InDesign document,i have one cell value like this,Testvalue..,value122...............
From that,i want to remove only the dotted lines at the end of text.how to check whether it is a character or a number using javascript..?
kindly help me..
Thanks in advance..!
Vimala L
Copy link to clipboard
Copied
use a regex:
http://www.javascriptkit.com/jsref/string.shtml
for example: myString.replace(/(\d+)\.+$/,"$1")
Copy link to clipboard
Copied
Thank u so much..Its working.
Copy link to clipboard
Copied
There is also a simple internal javascript function called isNaN(), meaning "is not a number".
It returns true (or -1) for non numeric values, and false (0) for numbers.
A decimal point inside a number is accepted as a number (for example "0.1"). isNaN is not locale dependant meaning that in countries using comma for decimal marker, we still get true from testing a value such as isNaN('0,1') )

