special char in NSString

When I load the audio name, some include char "[","]" How to convert such string include "[","]" to OBJ-C compatible string?

Welcome any comment Ken

-------------Problems Reply------------

An Objective-C string is defined with an @ and quotes. @"[" works fine for me ... Maybe you could clarify your question a bit?

To create a static NSString, do this:

NSString *stringA = @"a string with some square brackets [ ] ";

If you have a C string, you can create an NSString using the following methods (depending on whether your string is encoded in ASCII or UTF8:

char *utf8String;
NSString *stringB = [NSString stringWithUTF8String:utf8String];

char *asciiString;
NSString *stringC = [NSString stringWithCString:asciiString encoding: NSASCIIStringEncoding];

Category:iphone Views:0 Time:2010-11-14
Tags: iphone

Related post

  • Inserting special char un NSString for URL use 2010-06-16

    I'm using HTTP connection to share data with my JSON server. I use URLs like "MyServlet?param1=value1" and so on... I'm now facing a problem with one of my servlet (I can't change it because some other views are using it) : The servlet is working wit

  • ios convert NSString with special chars to const char 2012-03-28

    i m trying to draw a string with CGContextShowTextAtPoint. CGContextShowTextAtPoint only accepts "const char" as a string input. my problem is that some of the strings have special chars like ä,ö,ü etc in them. if i convert this strings to a "const c

  • How to escape all special chars before encoding a string used in a simple http post -objective-c 2011-01-17

    I'm building a request that will be a simple http POST. Inside this post I need to add a few items and one of these is a large viewstate string that is pulled down during a previous request. What I've noticed is that the raw request needs to have all

  • Problems passing special chars with observe_field 2008-08-27

    I am working on a rails project. Using the tag observe_field, I am taking text typed into a text area, processing it in a control, and displaying the result in a div (very similar to the preview in stack overflow). Everything works fine until I type

  • Regex Pattern - Allow alpha numeric, a bunch of special chars, but not a certain sequence of chars 2009-01-09

    I have the following regex: (?!^[&#]*$)^([A-Za-z0-9-'.,&@:?!()$#/\\]*)$ So allow A-Z, a-Z, 0-9, and these special chars '.,&@:?!()$#/\ I want to NOT match if the following set of chars is encountered anywhere in the string in this order:

  • problems reading CDATA section with special chars (ISO-8859-1 encoding) 2009-06-15

    I am trying to read a xml stream and load it into a collection. This works but Im having difficulties reading special chars. E.g. if my xml looks like this <?xml version="1.0" encoding="ISO-8859-1" ?> <persons> <person> <firstnam

  • Special chars in Python 2009-07-14

    i have to use special chars in my python-application. For example: ƃ I have information like this: U+0183 LATIN SMALL LETTER B WITH TOPBAR General Character Properties In Unicode since: 1.1 Unicode category: Letter, Lowercase Various Useful Represent

  • Regex that allows special chars? 2009-07-21

    The below regex requires that the password has 1 number, 1 char (upper or lower) and is a minimum of 8 in length. But if I type in a special char it returns false. I don't want to require a special char, but i want to allow it in this context. How ca

  • CSV File read. Special Chars problem 2009-07-27

    I have to edit a csv file, the problem is that my special chars like ó ã ç gets screwed up. Heres is a peice of my code: static void ReadFromFile(){ StreamReader SR = new StreamReader("c:\\Users\\Levy\\Documents\\Vale\\Base\\Desknote.csv", Encoding.D

  • MySQL cuts off string at special chars 2009-09-04

    I'm trying to insert remote POST data (articles sent by iSnare) into MySQL with PHP. Data comes successfully from remote POST sender and I can write it to plain-text file without a problem. Unfortunately, when it comes to insert it into MySQL, MySQL

  • why php's str_replace mess up the strings with special chars 2009-10-05

    why php's str_replace and many other string functions mess up the strings with special chars such ('é' 'à' ..) ? and how to fix this problem ? --------------Solutions------------- str_replace is not multi-byte (unicode) aware. use the according mb_*

  • Using special Chars in Firefox and IE, are being encoded by the browser differently 2009-10-29

    I've got a multilingual site, that allows users to input text to search a form field, but the text goes through Javascript before heading off to the backend. Special chars like "欢" are being properly handled in Firefox, but not in any version of IE.

  • Flash, JSON and special chars, how read òàùèéì on flash with JSON? 2009-12-10

    I've a problem loading a JSON with flash class com.adobe.serialization.json.JSON It works fine with everything except I haven't found a way to load special chars, so if i have { "json_text":"Hello, goodbye! I work fine!" } but If i need a special cha

  • Convert special chars to HTML entities, without changing tags and parameters 2009-12-11

    I'm using FreeTextBox editor to get some HTML created by users. The problem with this is this editor is not converting special chars in HTML entities at exception of "<>". I cannot use theHTML = Server.HtmlEncode(theHTML), because it converts a

  • Strong password regular expression that matches any special char 2010-01-11

    I need the following check for strong password validation: At least 7 chars At least 1 uppercase char (A-Z) At least 1 number (0-9) At least one special char I found and tweaked a RegEx and it's like this (sorry, I lost the reference...): ^.*(?=.{7,}

  • JavaME: How to use platformRequest to use special chars 2010-01-20

    How to use platformRequest to initiate a call involving special chars eg * or # Example: platformRequest("tel:*123#"); Or any alternative to platformRequest please. Details: Nokia N70 CLDC 1.0 MIDP 2.0 --------------Solutions------------- Well since

  • Using an url with & char and the rest of special chars 2010-01-30

    I'm trying to work with special chars in URLs but I have some trouble on undertand what I shuld do to get it works correctly. I've saw URLs like: http://www.last.fm/music/Simon+&+Garfunkel http://www.last.fm/music/小林武史 works perfectly on Last.FM,

  • NSFetchedResultsController, CoreData, SectionIndex and special chars (Umlaute..) 2010-02-04

    I am having problems with NSFechtedResultsController and using the created sectionIndex(data is coming from a CoreData storage). It seems to mix up the indexTitle versus the sectionName e.g. sectionName is "Ä" and sectionIndex is "Ƒ" (0x0191) regardi

  • How to Remove Space Additionally to the Special Chars? 2010-03-02

    in my functions.php if have this code: echo '<a href="'.preg_replace('/\s/','-',$search).'-keyword1.html">'.urldecode($search).'</a>'; this removes the special chars.. but how can i additonally add remove space and replace it with - and r

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.224 (s). 11 q(s)