REMOVE SPACE FROM STRING

Vikas Giri

Total Post:13

Points:91
Posted by  Vikas Giri
 1569  View(s)
Ratings:
Rate this:
how use trim method in javascript
give the sample of its?
  1. Amit Singh

    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>




Answer

NEWSLETTER

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