Help us understand the problem. What is going on with this article?

Swift3.0でのstringByTrimmingCharactersInSetの変更点

More than 3 years have passed since last update.

string.stringByTrimmingCharactersInSetがSwift3.0で使えなくなってます。

Swift2.0

var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString

Swift3.0

var cString = hex.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased()

Swift3.0では

trimmingCharacters

に変わっています。

tatetate55
仕事: swift, Obj-C,php 趣味: python, CAD 作ったものはブログにあげています。
http://www.tatetate55.com
yahoo-japan-corp
Yahoo! JAPAN を運営しています。
https://www.yahoo.co.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away