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
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
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
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?