Re: [Jprogramming] Trim trailing whitespace

2014-12-09 Thread Raul Miller
And, since 'strings' is automatically included in j803: '*',~dtb 'asdf ' asdf* -- Raul On Tue, Dec 9, 2014 at 9:57 AM, Kenneth Lettow wrote: > See http://www.jsoftware.com/docs/help803/user/lib_strings.htm . > > On Tue, Dec 9, 2014 at 9:53 AM, Jon Hough wrote: > >> Given a string, I am lo

Re: [Jprogramming] Trim trailing whitespace

2014-12-09 Thread Devon McCormick
May not be more elegant but more general: WS=. TAB,' ' str=. 'Trailing whitespace... ',TAB,' ',TAB -.str e. WS 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 i:~-.str e. WS 21 str{.~1 i:~-.str e. WS Trailing whitespace.. str{.~>:1 i:~-.str e. WS NB. Off by o

Re: [Jprogramming] Trim trailing whitespace

2014-12-09 Thread Kenneth Lettow
See http://www.jsoftware.com/docs/help803/user/lib_strings.htm . On Tue, Dec 9, 2014 at 9:53 AM, Jon Hough wrote: > Given a string, I am looking for a terse / elegant way to trim the > trailing whitespace, similar toJava / C# .trim() method for strings.This is > my version: > WS =: ' ' NB. white

[Jprogramming] Trim trailing whitespace

2014-12-09 Thread Jon Hough
Given a string, I am looking for a terse / elegant way to trim the trailing whitespace, similar toJava / C# .trim() method for strings.This is my version: WS =: ' ' NB. whitespace removeTrailing =: ]`}.@.(' ' = {.)^:_&.|. Is there a better way?