Skip to main content
100%

Gist 75454

✓ Published0🌍 Public
CCaged
Last edited Mar 7, 2009
Created on Mar 7, 2009

This example demonstrates string manipulation utilities in Objective-C, converting camelCase or mixed-case strings into either underscore-separated or dash-separated formats. The code defines an NSString category with `underscore` and `dasherize` methods, which internally call a private `normalizeWith:` method that iterates over each character, detects uppercase letters and existing delimiters, and inserts the chosen separator while preserving the original text. The implementation uses NSCharacterSet, NSMutableString, and unichar APIs to perform character-by-character processing, ultimately returning a lowercase version of the transformed string.

AI-generated description

Similar vizzes