Menu ▼



Posted By :
avatarmrkraju
Total Views : 827

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());






comments powered by Disqus


Search dotnetlearners.com