Javascript examples for String Operation:String Parse
Validate Jar file name
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script type="text/javascript"> function my()/*from w w w . ja va 2 s. c om*/ { var id_value = "validate.jar"; //Let I assume this if(id_value != '') { if(id_value.lastIndexOf(".jar") != -1) { console.log('OK'); } else { console.log('Invalid File') } } } my(); </script> </body> </html>