0
我不明白,这可怎么是:这怎么可能?红宝石如果循环失败
(byebug) missing_association_words.include?(@mtw.first.word)
false
(byebug) @mtw.first.word
text
(byebug) missing_association_words
text
这段代码返回false
虽然都包含相同的值。
我不明白,这可怎么是:这怎么可能?红宝石如果循环失败
(byebug) missing_association_words.include?(@mtw.first.word)
false
(byebug) @mtw.first.word
text
(byebug) missing_association_words
text
这段代码返回false
虽然都包含相同的值。
如果你想检查是否从第二数组中的值也包括在第一阵列中,您可以使用此:
(first_array & second_array).any?
而@mtw是什么? – 5208760
都是String class的'@ mtw.first.word'和'missing_association_words'? – shivam
值得检查'text'后面的空格。 – Shadwell