`needle.toString().data[0]` is better here -- we've already asserted it's a string and size > 0 so it's safe and unlike substr won't make an unnecessary string copy.