Gotten a hold on how to fetch and write to variables in Objective-C, now it’s time to learn how to do something more useful with them! Right now, I’m primarily trying to figure out how string manipulation works. In particular, I’m looking for the following functions:
- Concatenation
- Finding the length of a string (especially multi-byte/UTF-8 strings; I do a lot of work with East Asian languages)
- Pulling just a portion of a string (e.g. the “foobar” out of “abcfoobarxyz”)
- Searching within a string (see the above example)
- Changing case (upper, lower, title if it’s simple to do)
- Exploding/Imploding strings (e.g. creating and getting information from comma-separated lists)
- Find/Replace within strings
- Any other generally useful string functions that might be available
Examples:
Concatenation:
String Length:
Remove text from string:
Uppercase / Lowercase / Titlecase:
Find/Replace
I hope this helps!
PS: Don’t forget to check the documentation, and Google is your friend. Good luck