Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
具有多个用空格分隔的字符串的数组生成具有一个连接字符串的数组。恕我直言,它应该引发语法错误。这种行为正确吗?
["1" "2" "3"] #=> ["123"]
这与数组无关。这是字符串文字的一个特性。如果您将字符串文字写在彼此相邻的引号中,则它表示由串联给出的字符串。