Remove space from string

Total Post:13

Points:91
 1827  View(s)
Ratings:
Rate this:
how use trim method in javascript
give the sample of its?
  1. Post:103

    Points:721
    Re: Remove space from string

    hi vikas,
    in javascript, not using the trim method.
    but we replace the start and end space of any give string by javascript as given sample
     

    <script language="JavaScript" type="text/javascript">
        functionff() {
        var str="  check thetrim condition here      ";
            str=str.replace(/^\s+|\s+$/g,"");
            alert(str);
        }
    </script>



      Modified On Mar-29-2018 03:48:26 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!