Hi
I was doing some coding when I found the following Mata curiosity:
Is this a bug?
Or is there some good reason for this?
And is there a smarter way of getting the "proper" output than my select?
I was doing some coding when I found the following Mata curiosity:
Code:
: t1 = "This is a test"
: t2 = subinstr(t1, " ", char(9), .)
: t2
This09is09a09test
: tokens(t1) // Here space isn't in the output vector which is what I want
1 2 3 4
+-----------------------------+
1 | This is a test |
+-----------------------------+
: tokens(t2, char(9)) // Here for some reason char(9)/tab is in the output vector
1 2 3 4 5 6 7
+--------------------------------------------------+
1 | This 09 is 09 a 09 test |
+--------------------------------------------------+
: select(dummy=tokens(t2, char(9)), dummy :!= char(9)) // So I have to do something like this to get the proper output
1 2 3 4
+-----------------------------+
1 | This is a test |
+-----------------------------+
Or is there some good reason for this?
And is there a smarter way of getting the "proper" output than my select?

Comment