I'm going to be a PITA, but I just shed a tear seeing all the implicit conversions and `.last` call on a linear sequence... Would this work the same with `str.endsWith("$")`?