Find the position of a single non-matching character between two strings

It also fails this test:

julia> s1, s2 = "zzzz", "zzzx"
("zzzz", "zzzx")

julia> findfirst(==(only(setdiff(s1,s2))), s1)
ERROR: ArgumentError: Collection is empty, must contain exactly 1 element
2 Likes