jeggy
06/20/2022, 8:00 AMInt
and not a Long
?Vampire
06/20/2022, 8:06 AMjeggy
06/20/2022, 8:09 AMval myString = """hello(value: "something")"""
val invalid = (myString.sumOf { if(it == '"') 1 else 0 } % 2) != 0
Long
's as it's easier to write an L
behind the numberssumBy
but this function has been deprecated, but moving to sumOf
brought this issue.Tobias Suchalla
06/20/2022, 9:15 AMString.count
, i.e.:
val invalid = (myString.count { it == '"' } % 2) != 0
This also resolves the ambiguity :DAlexey Belkov [JB]
06/20/2022, 9:36 AM