LoginSignup
6
6

More than 5 years have passed since last update.

Swiftで文字列の前後の不要なスペース・改行を取り除く

Last updated at Posted at 2015-12-11

前後の全角スペースと改行を取り除く

string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())

前後の全角スペースを取り除く

string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())

前後の改行を取り除く

string.stringByTrimmingCharactersInSet(NSCharacterSet.newlineCharacterSet())
6
6
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6