Changeset 4de7dc8b06074dcb1bc12a1972161c17bc80f773

User picture

Commiter: Charles Childers

Author: Charles Childers

Parent: 0c0cded41d

(2010/05/01 22:39) Almost 2 years ago

add chomp to data/strings

Affected files

Updated library/data/strings.retro Download diff

0c0cded41dbdd216605fa0ac3a5371241d91b6404de7dc8b06074dcb1bc12a1972161c17bc80f773
1
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
1
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
2
( String Manipulation                                         )
2
( String Manipulation                                         )
3
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
3
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
4
( Copyright [c] 2009, Luke Parrish                            )
4
( Copyright [c] 2009 - 2010, Luke Parrish                     )
5
( Copyright [c] 2010, Marc Simpson                            )
5
( Copyright [c] 2010, Marc Simpson                            )
6
( License: ISC                                                )
6
( License: ISC                                                )
7
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
7
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
...
...
73
    dup 0 =if rdrop 2drop 0 ;then
73
    dup 0 =if rdrop 2drop 0 ;then
74
    r =if rdrop 1- ;then
74
    r =if rdrop 1- ;then
75
  again ;
75
  again ;
76
77
( Trim trailing spaces from a string ~~~~~~~~~~~~~~~~~~~~~~~~ )
78
: chomp ( $-$ )
79
  dup dup getLength + 1-
80
  dup @ 32 =if 0 swap ! heap -- dup 1- -- chomp ;then drop ;