Did you try val1 != [“GM”] ?
Your first print statement shows val1 is a vector containing one string and not simply a string. So your test as written will fail.
You could alternatively use val1[1] to make the comparison with the first string in the vector.