• 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
want backslash in NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

want backslash in NSString


  • Subject: want backslash in NSString
  • From: Christopher Anand <email@hidden>
  • Date: Sun, 30 Dec 2001 21:02:57 -0500

How do I get a backslash in an NSString?

I have tried the following:

string = [NSString stringWithCString: "\include" length:8]; // give compiler warning
NSLog(string);
string = [NSString stringWithCString: "\\include" length:8];
NSLog(string);
string = [NSString stringWithCString: "\binclude" length:8];
NSLog(string);
cstring = "\\include";
printf("%s\n",cstring);

with the results:

2001-12-30 20:41:38.144 CircleView[403] include\\000
2001-12-30 20:41:38.145 CircleView[403] \\\\include
2001-12-30 20:41:38.145 CircleView[403] \\010include
\include

Obviously I don't understand text handling in Foundation. I need the backslash because I am saving a pdf file for inclusion in a latex document, and I want to put the latex graphics command in the paste buffer to save me a bit of typing (and a chance for typos).

Christopher Anand


  • Follow-Ups:
    • Re: want backslash in NSString
      • From: Ondra Cada <email@hidden>
    • Re: want backslash in NSString
      • From: Fritz Anderson <email@hidden>
    • Re: want backslash in NSString
      • From: Andreas Monitzer <email@hidden>
    • Re: want backslash in NSString
      • From: Andrew Pinski <email@hidden>
  • Prev by Date: Cocoa questions
  • Next by Date: Re: want backslash in NSString
  • Previous by thread: Re: Cocoa questions
  • Next by thread: Re: want backslash in NSString
  • Index(es):
    • Date
    • Thread