Skip to content

string

Cast to string

string x    string[x]

Returns x as a string. Applies to all datatypes.

q)string `ibm
"ibm"
q)string 2
,"2"
q)string {x*x}
"{x*x}"
q)string (+/)
"+/"

Implicit iteration

string is an atomic function and iterates through dictionaries and tables.

q)string (2 3;"abc")
(,"2";,"3")
(,"a";,"b";,"c")

q)string "cat"        / not the no-op you might expect
,"c"
,"a"
,"t"

q)string `a`b`c!2002 2004 2010
a| "2002"
b| "2004"
c| "2010"

q)string ([]a:1 2 3;b:`ibm`goog`aapl)
a    b
-----------
,"1" "ibm"
,"2" "goog"
,"3" "aapl"

Domain and range

domain b g x h i j e f c s p m d z n u v t
range  c c c c c c c c c c c c c c c c c c

Range: c


  .h namespace
  .Q.addr (IP address), .Q.f (format), .Q.fmt (format)
Q for Mortals §7.3.1 Data to Strings