Results 1 to 4 of 4

Thread: trim function

  1. #1

    Thread Starter
    Junior Member lemenz70's Avatar
    Join Date
    Apr 2005
    Location
    Canada (Quebec)
    Posts
    23

    Resolved trim function

    hi all
    I am student and I have to make an exercise that requires to trim a StringBuffer. Is there any trim command i can use and if yes do i have to add some import or something?
    thanks


    Edit: I found a trim function for the String format but I am still searching for a StringBuffer one.


    <Moderator added green check mark to the thread>
    Last edited by NoteMe; Apr 15th, 2005 at 06:51 AM.

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: trim function

    Something like this:

    Code:
    StringBuffer sb = new StringBuffer();
    sb.append("   Three begin spaces, two ending  ");
    System.out.println(sb.toString().trim());

  3. #3

    Thread Starter
    Junior Member lemenz70's Avatar
    Join Date
    Apr 2005
    Location
    Canada (Quebec)
    Posts
    23

    Re: trim function

    thank you System_Error!

  4. #4
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: trim function

    Quote Originally Posted by lemenz70
    thank you System_Error!
    Your very welcome.

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