Swift4 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range upt

NoSuchKey