Results 1 to 3 of 3

Thread: triming problem

  1. #1

    Thread Starter
    Hyperactive Member buddu's Avatar
    Join Date
    Jul 2001
    Location
    India
    Posts
    446

    Question triming problem

    hi there
    how to trim the word using the javascript.

    i mean
    x=" Content"

    resuld has to x="Content"

    how to do this using javascript

    my code is var s=new String(x);
    m=s.trim();
    I got the Error: Object not found;


    please help me

    buddu
    prasad

  2. #2
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464
    Use trim in a VBScript function.
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

  3. #3
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602
    I wrote this a little while back:
    Code:
      function Trim(strString){
        //Trim() function removes spaces at either end
        //of the string and removes all extra spaces
    
        var strSplit;        //Array of arg string split on spaces
        var strReturnString; //String to return
    
        // Split the string on all spaces.
        //All spaces are discarded and only
        //the characters remain.
        // /\s+/ is a Regular Expression that
        //represents a space character
    
        strSplit = strString.split(/\s+/);
    
    
       //Rejoin the string using a space.
    
       strReturnString = strSplit.join(" ");
    
    
        return strReturnString;
    
      }//end function
    Try it out and let me know if it works for you...
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width