Skip to content

Instantly share code, notes, and snippets.

@itoz
Created September 19, 2014 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itoz/eea1218ea83f7b4f0733 to your computer and use it in GitHub Desktop.
Save itoz/eea1218ea83f7b4f0733 to your computer and use it in GitHub Desktop.
[objc] ダブルクォートをシングルクォートにし、改行をとる JSにOBJECTテキスト渡すときとかにつかう
//ダブルクォートをシングルクォートにし、改行をとる
NSStirng * string = @"hogehoge";
string = [string stringByReplacingOccurrencesOfString:@"\"" withString:@"\'"];
string = [string stringByReplacingOccurrencesOfString:@"\n" withString:@""];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment