Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Question about accessing a value within a NSString or NSMutableString

Question about accessing a value within a NSString or NSMutableString
Thread Tools
Dedicated MacNNer
Join Date: Dec 2003
Status: Offline
Reply With Quote
Jul 28, 2004, 06:30 PM
 
I was just curious if it is possible to directly access a value at index i in a NSString? In C++ string's, I can go StrinVar[i] = value. Is this possible with a NSString or NSMutableString? Can I directly replace a character with a String in a similar way that replaceOccurrencesOfString can change a value a range? I would like to do this for one value at a time.
15 inch MacBook Pro 2.16 GHz, 2 GB RAM, 7200 RPM 100GB HDD.

Dual 2.5 GHz Power Mac G5, 1 GB RAM, 250 GB HDD, ATI Radeon X800XT.
     
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Jul 28, 2004, 07:12 PM
 
http://developer.apple.com/documenta...racterAtIndex_

check this app out to help you navigate through the api's...
http://homepage.mac.com/aglee/downloads/
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Jul 28, 2004, 07:22 PM
 
Originally posted by KraziKid:
I was just curious if it is possible to directly access a value at index i in a NSString? In C++ string's, I can go StrinVar[i] = value. Is this possible with a NSString or NSMutableString? Can I directly replace a character with a String in a similar way that replaceOccurrencesOfString can change a value a range? I would like to do this for one value at a time.
what about the NSMutableString method "replaceCharactersInRange:withString:" and use a range of 1 character?
     
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Jul 28, 2004, 07:29 PM
 
oye, that's what I get for skimming. I thought access meant read. The api'll still help ya... look around a bit
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:06 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2