replacing in strings
replacing in strings
- Subject: replacing in strings
- From: Peter Schols <email@hidden>
- Date: Wed, 23 Jan 2002 00:55:34 +0100
Hi,
I would like to know how I can replace a space in a string by \space
For example, I need to replace
/Volumes/Macintosh HD
with
/Volumes/Macintosh\ HD (like in UNIX paths)
I can replace the space with another string:
[hugeStr replaceCharactersInRange:[hugeStr rangeOfString:@" "]
withString:@"FOO"];
so I can get /Volumes/MacintoshFOOHD, but PB doesn't want to replace it
with "\ , because it's an unknown escape sequence.
What's the best way to solve this?
Thanks!
Peter