• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
replacing in strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: replacing in strings
      • From: Adam Eijdenberg <email@hidden>
  • Prev by Date: RE: How to make Tiff with a mask?
  • Next by Date: Re: message to nil? (very basic question)
  • Previous by thread: Re: Two-Dimensional Arrays
  • Next by thread: Re: replacing in strings
  • Index(es):
    • Date
    • Thread