result_list
#> # A tibble: 50 × 3
#> page date
#> <chr> <chr>
#> 1 Seite 2/490 <NA>
#> 2 Seite 1/490 Sendung vom 24.04.2017
#> 3 Seite 1/490 Sendung vom 21.04.2017
#> 4 Seite 1/490 Sendung vom 20.04.2017
#> 5 Seite 1/490 Sendung vom 19.04.2017
#> 6 Seite 1/490 Sendung vom 18.04.2017
#> 7 Seite 1/490 Sendung vom 15.04.2017
#> 8 Seite 1/490 Sendung vom 13.04.2017
#> 9 Seite 1/490 Sendung vom 12.04.2017
#> 10 Seite 1/490 Sendung vom 11.04.2017
#> # ... with 40 more rows, and 1 more variables: text <chr>
这不匹配。
我也试过了:
case 'this is not a test'
when 'this is not a test'.eql?('this is not a test')
p '1'
end
并正确更改my_var = 'this is not a test'
语句。case
次尝试。答案 0 :(得分:4)
当然不匹配。
'this is not a test'.eql?('this is not a test')
评估为true
。
case x when y .... end
评估为if y === x ... end
。
true === 'this is not a test'
评估为false
。
您要么case when x ... end
,评估为if x ... end
,语法略有不同,语义不同:
case
when 'this is not a test'.eql?('this is not a test')
p '1'
end
或者,如果您对===
而不是eql?
感到满意,可以写
case 'this is not a test'
when 'this is not a test'
p '1'
end