Filtering in k?

For instance, if a have a string:

p:“abc def”

I want to remove all the spaces. In k2, I’ve done this:

pm:{~x=" "}'p
p:(pm[>pm]?0)#p@>pm

In k3, is there a better way? Or is there a better way in k2 that I missed?


Sent from my Android device with K-9 Mail. Please excuse my brevity.

In q you could do

q)p except " "

“abcdef”

which in k4 would translate to

k)p@&~p=" "

“abcdef”

Thanks

Tom

On June 3, 2015 12:19:59 PM CDT, Tom Martin wrote:

>In q you could do

>

>q)p except " "

>“abcdef”

>

>which in k4 would translate to

>

>k)p@&~p=" "

>“abcdef”

>

>



Thanks! I forgot that you could equate strings to chars.



>Thanks

>Tom

>

>

>On Wednesday, June 3, 2015 at 6:16:52 PM UTC+1, Ryan Gonzalez wrote:

>>

>> For instance, if a have a string:

>>

>> p:“abc def”

>>

>> I want to remove all the spaces. In k2, I’ve done this:

>>

>> pm:{~x=" "}'p

>> p:(pm[>pm]?0)#p@>pm

>>

>> In k3, is there a better way? Or is there a better way in k2 that I

>missed?

>>

>> –

>> Sent from my Android device with K-9 Mail. Please excuse my brevity.





Sent from my Android device with K-9 Mail. Please excuse my brevity.