Created
April 6, 2012 13:43
-
-
Save gorkunov/2319900 to your computer and use it in GitHub Desktop.
objective-c bro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[4/6/12 5:24:04 PM] ziryanov.ivan | |
мне надо строку типа "SepiaTone" сделать "Sepia Tone" | |
как это регуляркой сделать? | |
[4/6/12 5:29:04 PM] Alexander Gorkunov: | |
вот так на js "SepiaTone".replace(/([A-Z][a-z]+)/g, "$1 ") | |
ну можно еще trim сделать в конце | |
[4/6/12 5:40:53 PM] ziryanov.ivan: | |
вот так это получилось на обжектив си) | |
name = [[[NSRegularExpression alloc] initWithPattern:@"(.[A-Z])" options:0 error:0] stringByReplacingMatchesInString:name options:0 range:NSMakeRange(0, [name length]) withTemplate:@"$1 "]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added some black magic and negative lookahead assertions ;-)