Menu ▼



Posted By :
avatarmrkraju
Total Views : 885

Javascript regular expression for string trim funtion

    <script language="javascript">

        String.prototype.trim = function () { return this.replace(/^\s*/, "").replace(/\s*$/, ""); }   

    </script>

 Usage :

alert("    test   ".trim());








Search dotnetlearners.com