Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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
You can’t perform that action at this time.