Prior to being forced to switch to Swift 3.0 syntax, the following line worked just fine:
Value of Type 'String' has no member 'StringByTrimmingCharactersInSet'
Swift3 inctroduced a lot of changes shortening api names and making them more 'swiftly'. Your code would look the following in swift3:
let st = s.trimmingCharacters(in: unwantedChars)