Right Trim 
Author Message
 Right Trim

Hi,
    Could someone tell me how to trim the spaces on the right of a
string.

Thanks

  jburdey.vcf
< 1K Download


Sun, 27 Jun 2004 23:54:43 GMT  
 Right Trim

Quote:
>     Could someone tell me how to trim the spaces on the right of a
> string.

sub(/ *$/,"",mystring)

Regards,
   =Adrian=



Mon, 28 Jun 2004 00:18:50 GMT  
 Right Trim

Quote:

> Hi,
>     Could someone tell me how to trim the spaces on the right of a
> string.

> Thanks

can you describe why you need this and show a starting example and a finished
example ?


Mon, 28 Jun 2004 00:21:01 GMT  
 Right Trim
function trim(str)
{
      sub("[ ]*$", "", str);
      return str;
Quote:
}

> Hi,
>     Could someone tell me how to trim the spaces on the right of a
> string.

> Thanks

> --



Mon, 28 Jun 2004 05:23:01 GMT  
 Right Trim

Quote:


> > Could someone tell me how to trim the spaces on the right of a
> > string.

> sub(/ *$/,"",mystring)

    sub(/ +$/, "", string)

or

    sub(/[ \t]+$/, "", string)

or

    sub(/[[:blank:]]+$/, "", string)

or

    sub(/[[:space:]]+$/, "", string)

--
Jim Monty

Tempe, Arizona USA



Mon, 28 Jun 2004 13:09:08 GMT  
 Right Trim
...

Quote:
>     sub(/[[:space:]]+$/, "", string)

Newlines, vertical tabs and form feeds aren't generally removed from strings
in languages that include built-in TRIM procedures. Maybe including vertical
tabs makes some sense, but decidedly nonobvious that removing newlines and
form feeds would be a good thing.


Tue, 29 Jun 2004 05:09:08 GMT  
 Right Trim

Quote:




> > > > Could someone tell me how to trim the spaces on the right of a
> > > > string.

> > > sub(/ *$/,"",mystring)

> >     sub(/ +$/, "", string)

> > or

> >     sub(/[ \t]+$/, "", string)

> > or

> >     sub(/[[:blank:]]+$/, "", string)

> > or

> >     sub(/[[:space:]]+$/, "", string)

> Newlines, vertical tabs and form feeds aren't generally removed from strings
> in languages that include built-in TRIM procedures. Maybe including vertical
> tabs makes some sense, but decidedly nonobvious that removing newlines and
> form feeds would be a good thing.

Wow! Thanks!


Wed, 30 Jun 2004 11:13:51 GMT  
 Right Trim
You're misquoting me. I snipped everything but the one statement I commented
on. Naturally, you prefer to see all the digital diarrhea you've spewed. I
suppose you just can't stop yourself sometimes.

Then again, you like TMTOWTDI, but you so often manage TMTOWTDIW.



Thu, 01 Jul 2004 04:33:18 GMT  
 Right Trim
On Wed, 09 Jan 2002 15:54:43 GMT, Jason Burdey


Quote:
>    Could someone tell me how to trim the spaces on the right of a
>string.

You might want to check the following post on DejaGoo:

<http://groups.google.com/groups?q=+%22function+ELength(src,+tln)%22&h...>

--
Charles Calvert             |  Software Design/Development
Celtic Wolf, Inc.           |  Project Management
http://www.celticwolf.com/  |  Technical Writing
(703) 580-0210              |  Research



Sun, 11 Jul 2004 02:12:40 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Left / Right Trim in IBM COBOL

2. Right, left, Right.

3. Update on what happens to data to the right of the right margin

4. A verb to trim spaces from a string

5. Problem with generic trim function

6. curly braces and trim missing in VW

7. trim()?

8. How to trim ending spaces from a var?

9. "Trimming" blanks

10. Trimming Text file

11. File Conversion: UNIX.txt to DOS.txt and trim trailing blanks

12. Trimming

 

 
Powered by phpBB® Forum Software